public void NewCompile(IOpTask r) { var parse = TypeParse.Parse(r.OpCode); var find = Methods.Find(rx => rx.MethodDefinition.CallName == parse.CallName); //本地查找 if (find == null && parse.TypeDefine != null) { find = parse.TypeDefine.Methods.Find(rx => rx.MethodDefinition.CallName == parse.CallName); if (find == null) { throw new NotSupportedException(); } } if (find != null) { r.Method = find; r.V3(find); //r.GetType().GetField("V3").SetValue(r, find); } else { //try clr cross var method = Cross.CrossDomain.Build(r.OpCode.Arg1 + " " + r.OpCode.Arg2); r.Method = method; //r.GetType().GetField("V3").SetValue(r, method); r.V3(method); } }
public void MethodCompile(IOpTask r) { var parse = TypeParse.Parse(r.OpCode); var find = Methods.Find(rx => rx.MethodDefinition.CallName == parse.CallName); //本地查找 if (find == null && parse.TypeDefine != null) { find = parse.TypeDefine.Methods.Find(rx => rx.MethodDefinition.CallName == parse.CallName); if (find == null) { var t = Extensions.GetTypeDefineByName(parse.TypeDefine.TypeDefinition.FullName); if (t != null) { find = t.Methods.Find(rx => rx.MethodDefinition.CallName == parse.CallName); } throw new NotSupportedException(); } else { if (find.MethodDefinition.IsGenerics) { CallNameDefine callName = parse.CallName; var args = callName.GetGenericsArgs(); find.GenericsArgs = args; find = find.ReBuild(); } } } if (find != null) { r.Method = find; r.V3(find); //r.GetType().GetField("V3").SetValue(r, find); } else { //try clr cross var method = Cross.CrossDomain.Build(parse.CallName); r.Method = method; //r.GetType().GetField("V3").SetValue(r, method); r.V3(method); } }