// Copyright 2009 (c) Charles Cook using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Reflection; namespace CookComputing { class NOptFunc { //-------------------------------------------------------------------------/ public static object Run(MethodInfo mi, string[] args) { return Run(null, mi, args); } //-------------------------------------------------------------------------/ public static object Run(object instance, MethodInfo mi, string[] args) { var result = AnalyzeParameters(mi); ParseArgs(args, result.Item1, result.Item2); object[] parameters = result.Item1.Select(v => v.Value).Concat( result.Item2.Select(v => v.Value)).ToArray(); return mi.Invoke(instance, parameters); } //-------------------------------------------------------------------------/ private static Tuple, List