示例#1
0
    object DoStaticMethod(CLRSharp.ThreadContext context, string type, string method)
    {
        CLRSharp.ICLRType wt = env.GetType(type);

        CLRSharp.IMethod methodctor = wt.GetMethod(method, CLRSharp.MethodParamList.constEmpty());//取得构造函数
        return(methodctor.Invoke(context, null, null));
    }
示例#2
0
 void InvokeMethod(CLRSharp.ThreadContext context, string type, string method)
 {
     CLRSharp.ICLRType          wt         = env.GetType(type);                                             //用全名称,包括命名空间
     CLRSharp.CLRSharp_Instance to         = new CLRSharp.CLRSharp_Instance(wt as CLRSharp.ICLRType_Sharp); //创建实例
     CLRSharp.IMethod           methodctor = wt.GetMethod(".ctor", CLRSharp.MethodParamList.constEmpty());  //取得构造函数
     methodctor.Invoke(context, to, null);                                                                  //执行构造函数
     CLRSharp.IMethod mt = wt.GetMethod(method, CLRSharp.MethodParamList.constEmpty());
     mt.Invoke(context, to, null);
 }
示例#3
0
    public void Fix(string str, params object[] param)
    {
        string id = str;

        string[] nameArray  = id.Split(',');
        string   className  = nameArray[0];
        string   methodName = nameArray[1];


        CLRSharp.ICLRType wantType = env.GetType("HotFix." + className + "Hot");
        var list = CLRSharp.MethodParamList.Make(GetTypes(str));

        CLRSharp.IMethod method;
        method = wantType.GetMethod(methodName, list);
        method.Invoke(context, null, param);
    }