Пример #1
0
        private MethodInfo Bind(GenericArgumentBinder binder, MethodInfo method, Type descriptorType)
        {
            MethodInfo bindedMethod;

            if (binder.TryBind(method, new[] { descriptorType }, out bindedMethod))
            {
                return(bindedMethod);
            }

            return(null);
        }
Пример #2
0
        public static void Main(string[] args)
        {
            GenericArgumentBinder binder = new GenericArgumentBinder();

            MethodInfo[] methods;
            MethodInfo   method;

            binder.TryBind(typeof(MyClass).GetMethod("MyMethod2"),
                           new Type[] { typeof(MyClass2[]) },
                           out methods);

            int[] array = {};
            MyStaticClass.NewTest <object>(array);
        }