Ejemplo n.º 1
0
        public static object CallS(Type t, string MethodName, params object[] Params)
        {
            MethodInfo info;

            Type[] types = null;
            if (Params != null && Params.Length > 0)
            {
                types = new Type[Params.Length];
                for (int i = 0; i < Params.Length; ++i)
                {
                    types[i] = Params[i].GetType();
                }
                info = t.GetMethod(MethodName, BindingFlags.Static | BindingFlags.Public | BindingFlags.ExactBinding, null, types, null);
            }
            else
            {
                info = t.GetMethod(MethodName, BindingFlags.Static | BindingFlags.Public);
            }
            return(Cache.CallMethod(t, null, info, null, Params));
        }
Ejemplo n.º 2
0
        public object Call(string MethodName, params object[] Params)
        {
            MethodInfo info;

            Type[] types = null;
            if (Params != null && Params.Length > 0)
            {
                types = new Type[Params.Length];
                for (int i = 0; i < Params.Length; ++i)
                {
                    types[i] = Params[i].GetType();
                }
                info = _type.GetMethod(MethodName, BindingFlags.ExactBinding | BindingFlags.Public | BindingFlags.Instance, null, types, null);
            }
            else
            {
                info = _type.GetMethod(MethodName, BindingFlags.Public | BindingFlags.Instance);
            }

            return(Cache.CallMethod(_type, _instance, info, types, Params));
        }