예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
 public static void V1(this IOpTask task, object value)
 {
     task.GetType().GetField("V1").SetValue(task, value);
 }
예제 #4
0
 public static object V1(this IOpTask task)
 {
     return(task.GetType().GetField("V1").GetValue(task));
 }