コード例 #1
0
ファイル: CallSiteTests.cs プロジェクト: rsumner31/corefx2
        public void CannotCreateForNonDelegate()
        {
            string         msg    = AssertExtensions.Throws <ArgumentException>(null, () => CallSite <Expression> .Create(null)).Message;
            CallSiteBinder binder = new CallSiteBinderDefaultBehaviourTests.NopCallSiteBinder();

            Assert.Equal(msg, AssertExtensions.Throws <ArgumentException>(null, () => CallSite <Expression> .Create(binder)).Message);
            Assert.Equal(msg, AssertExtensions.Throws <ArgumentException>(null, () => CallSite.Create(typeof(Expression), binder)).Message);
        }
コード例 #2
0
ファイル: Class4.cs プロジェクト: unionjl/CyberAIO
    // Token: 0x06000047 RID: 71 RVA: 0x00008A28 File Offset: 0x00006C28
    public void method_4(string string_3, string string_4, bool bool_2, bool bool_3)
    {
        if (Class4.Class7.callSite_6 == null)
        {
            Class4.Class7.callSite_6 = CallSite <Func <CallSite, object, bool> > .Create(Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsTrue, typeof(Class4), new CSharpArgumentInfo[]
            {
                CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
            }));
        }
        Func <CallSite, object, bool> target = Class4.Class7.callSite_6.Target;
        CallSite callSite_ = Class4.Class7.callSite_6;
        bool     flag;
        object   obj;

        if (flag = MainWindow.dictionary_0.ContainsKey((int)this.jtoken_1["id"]))
        {
            if (Class4.Class7.callSite_1 == null)
            {
                Class4.Class7.callSite_1 = CallSite <Func <CallSite, bool, object, object> > .Create(Binder.BinaryOperation(CSharpBinderFlags.BinaryOperationLogical, ExpressionType.And, typeof(Class4), new CSharpArgumentInfo[]
                {
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null),
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
                }));
            }
            Func <CallSite, bool, object, object> target2 = Class4.Class7.callSite_1.Target;
            CallSite callSite_2 = Class4.Class7.callSite_1;
            bool     arg        = flag;
            if (Class4.Class7.callSite_0 == null)
            {
                Class4.Class7.callSite_0 = CallSite <Func <CallSite, object, bool, object> > .Create(Binder.BinaryOperation(CSharpBinderFlags.None, ExpressionType.Equal, typeof(Class4), new CSharpArgumentInfo[]
                {
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null),
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, null)
                }));
            }
            obj = target2(callSite_2, arg, Class4.Class7.callSite_0.Target(Class4.Class7.callSite_0, MainWindow.dictionary_0[(int)this.jtoken_1["id"]]["stop"], false));
        }
        else
        {
            obj = flag;
        }
        object obj2 = obj;

        if (Class4.Class7.callSite_3 == null)
        {
            Class4.Class7.callSite_3 = CallSite <Func <CallSite, object, bool> > .Create(Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsTrue, typeof(Class4), new CSharpArgumentInfo[]
            {
                CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
            }));
        }
        object obj3;

        if (!Class4.Class7.callSite_3.Target(Class4.Class7.callSite_3, obj2))
        {
            if (Class4.Class7.callSite_2 == null)
            {
                Class4.Class7.callSite_2 = CallSite <Func <CallSite, object, bool, object> > .Create(Binder.BinaryOperation(CSharpBinderFlags.BinaryOperationLogical, ExpressionType.Or, typeof(Class4), new CSharpArgumentInfo[]
                {
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null),
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null)
                }));
            }
            obj3 = Class4.Class7.callSite_2.Target(Class4.Class7.callSite_2, obj2, bool_3);
        }
        else
        {
            obj3 = obj2;
        }
        object obj4 = obj3;

        if (Class4.Class7.callSite_5 == null)
        {
            Class4.Class7.callSite_5 = CallSite <Func <CallSite, object, bool> > .Create(Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsFalse, typeof(Class4), new CSharpArgumentInfo[]
            {
                CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
            }));
        }
        object arg2;

        if (!Class4.Class7.callSite_5.Target(Class4.Class7.callSite_5, obj4))
        {
            if (Class4.Class7.callSite_4 == null)
            {
                Class4.Class7.callSite_4 = CallSite <Func <CallSite, object, bool, object> > .Create(Binder.BinaryOperation(CSharpBinderFlags.BinaryOperationLogical, ExpressionType.And, typeof(Class4), new CSharpArgumentInfo[]
                {
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null),
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null)
                }));
            }
            arg2 = Class4.Class7.callSite_4.Target(Class4.Class7.callSite_4, obj4, !this.bool_0);
        }
        else
        {
            arg2 = obj4;
        }
        if (target(callSite_, arg2))
        {
            if (bool_2)
            {
                GClass3.smethod_0(string_3, "Task " + this.jtoken_1["id"]);
            }
            if (string_3.ToLower().Contains("error"))
            {
                string_4 = "red";
            }
            if (!this.bool_1)
            {
                MainWindow.webView_0.QueueScriptCall(string.Format("updateTable('{0}','{1}',{2},7)", string_3, string_4, this.jtoken_1["id"]));
                return;
            }
        }
        else
        {
            Thread.CurrentThread.Abort();
        }
    }
コード例 #3
0
            private void MakeReverseDelegateWorker(CodeContext context)
            {
                Type[] sigTypes;
                Type[] callSiteType;
                Type   retType;

                GetSignatureInfo(out sigTypes, out callSiteType, out retType);

                DynamicMethod dm    = new DynamicMethod("ReverseInteropInvoker", retType, ArrayUtils.RemoveLast(sigTypes), DynamicModule);
                ILGenerator   ilGen = dm.GetILGenerator();
                PythonContext pc    = PythonContext.GetContext(context);

                Type     callDelegateSiteType = CompilerHelpers.MakeCallSiteDelegateType(callSiteType);
                CallSite site = CallSite.Create(callDelegateSiteType, pc.Invoke(new CallSignature(_argtypes.Length)));

                List <object> constantPool = new List <object>();

                constantPool.Add(null); // 1st item is the target object, will be put in later.
                constantPool.Add(site);

                ilGen.BeginExceptionBlock();

                //CallSite<Func<CallSite, object, object>> mySite;
                //mySite.Target(mySite, target, ...);

                LocalBuilder siteLocal = ilGen.DeclareLocal(site.GetType());

                ilGen.Emit(OpCodes.Ldarg_0);
                ilGen.Emit(OpCodes.Ldc_I4, constantPool.Count - 1);
                ilGen.Emit(OpCodes.Ldelem_Ref);
                ilGen.Emit(OpCodes.Castclass, site.GetType());
                ilGen.Emit(OpCodes.Stloc, siteLocal);
                ilGen.Emit(OpCodes.Ldloc, siteLocal);
                ilGen.Emit(OpCodes.Ldfld, site.GetType().GetField("Target"));
                ilGen.Emit(OpCodes.Ldloc, siteLocal);

                // load code context
                int contextIndex = constantPool.Count;

                Debug.Assert(pc.SharedContext != null);
                constantPool.Add(pc.SharedContext);
                ilGen.Emit(OpCodes.Ldarg_0);
                ilGen.Emit(OpCodes.Ldc_I4, contextIndex);
                ilGen.Emit(OpCodes.Ldelem_Ref);

                // load function target, in constant pool slot 0
                ilGen.Emit(OpCodes.Ldarg_0);
                ilGen.Emit(OpCodes.Ldc_I4_0);
                ilGen.Emit(OpCodes.Ldelem_Ref);

                // load arguments
                for (int i = 0; i < _argtypes.Length; i++)
                {
                    INativeType nativeType = _argtypes[i];
                    nativeType.EmitReverseMarshalling(ilGen, new Arg(i + 1, sigTypes[i + 1]), constantPool, 0);
                }

                ilGen.Emit(OpCodes.Call, callDelegateSiteType.GetMethod("Invoke"));

                LocalBuilder finalRes = null;

                // emit forward marshaling for return value
                if (_restype != null)
                {
                    LocalBuilder tmpRes = ilGen.DeclareLocal(typeof(object));
                    ilGen.Emit(OpCodes.Stloc, tmpRes);
                    finalRes = ilGen.DeclareLocal(retType);

                    ((INativeType)_restype).EmitMarshalling(ilGen, new Local(tmpRes), constantPool, 0);
                    ilGen.Emit(OpCodes.Stloc, finalRes);
                }
                else
                {
                    ilGen.Emit(OpCodes.Pop);
                }

                // } catch(Exception e) {
                // emit the cleanup code

                ilGen.BeginCatchBlock(typeof(Exception));

                ilGen.Emit(OpCodes.Ldarg_0);
                ilGen.Emit(OpCodes.Ldc_I4, contextIndex);
                ilGen.Emit(OpCodes.Ldelem_Ref);
                ilGen.Emit(OpCodes.Call, typeof(ModuleOps).GetMethod("CallbackException"));

                ilGen.EndExceptionBlock();

                if (_restype != null)
                {
                    ilGen.Emit(OpCodes.Ldloc, finalRes);
                }
                ilGen.Emit(OpCodes.Ret);

                _reverseDelegateConstants = constantPool;
                _reverseDelegateType      = GetReverseDelegateType(ArrayUtils.RemoveFirst(sigTypes), CallingConvention);
                _reverseDelegate          = dm;
            }
コード例 #4
0
        public ActionResult SubPageEdit(FormCollection collection)
        {
            RoadFlow.Platform.AppLibrarySubPages   appLibrarySubPages = new RoadFlow.Platform.AppLibrarySubPages();
            RoadFlow.Data.Model.AppLibrarySubPages model1             = (RoadFlow.Data.Model.AppLibrarySubPages)null;
            string str1 = this.Request.QueryString["subid"];

            if (str1.IsGuid())
            {
                model1 = appLibrarySubPages.Get(str1.ToGuid());
            }
            if (collection != null)
            {
                string str2  = this.Request.Form["Title"];
                string str3  = this.Request.Form["Address"];
                bool   flag1 = false;
                if (model1 == null)
                {
                    model1              = new RoadFlow.Data.Model.AppLibrarySubPages();
                    flag1               = true;
                    model1.ID           = Guid.NewGuid();
                    model1.AppLibraryID = this.Request.QueryString["id"].ToGuid();
                }
                model1.Name    = str2.Trim1();
                model1.Address = str3.Trim1();
                using (TransactionScope transactionScope = new TransactionScope())
                {
                    if (flag1)
                    {
                        appLibrarySubPages.Add(model1);
                        RoadFlow.Platform.Log.Add("添加了子页面", model1.Serialize(), RoadFlow.Platform.Log.Types.菜单权限, "", "", (RoadFlow.Data.Model.Users)null);
                        // ISSUE: reference to a compiler-generated field
                        if (AppLibraryController.\u003C\u003Eo__8.\u003C\u003Ep__0 == null)
                        {
                            // ISSUE: reference to a compiler-generated field
                            AppLibraryController.\u003C\u003Eo__8.\u003C\u003Ep__0 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "Script", typeof(AppLibraryController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                            {
                                CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                                CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null)
                            }));
                        }
                        // ISSUE: reference to a compiler-generated field
                        // ISSUE: reference to a compiler-generated field
                        object obj = AppLibraryController.\u003C\u003Eo__8.\u003C\u003Ep__0.Target((CallSite)AppLibraryController.\u003C\u003Eo__8.\u003C\u003Ep__0, this.ViewBag, "alert('添加成功!');window.location='SubPages" + this.Request.Url.Query + "';");
                    }
                    else
                    {
                        appLibrarySubPages.Update(model1);
                        RoadFlow.Platform.Log.Add("修改了子页面", model1.Serialize(), RoadFlow.Platform.Log.Types.菜单权限, "", "", (RoadFlow.Data.Model.Users)null);
                        // ISSUE: reference to a compiler-generated field
                        if (AppLibraryController.\u003C\u003Eo__8.\u003C\u003Ep__1 == null)
                        {
                            // ISSUE: reference to a compiler-generated field
                            AppLibraryController.\u003C\u003Eo__8.\u003C\u003Ep__1 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "Script", typeof(AppLibraryController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                            {
                                CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                                CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null)
                            }));
                        }
                        // ISSUE: reference to a compiler-generated field
                        // ISSUE: reference to a compiler-generated field
                        object obj = AppLibraryController.\u003C\u003Eo__8.\u003C\u003Ep__1.Target((CallSite)AppLibraryController.\u003C\u003Eo__8.\u003C\u003Ep__1, this.ViewBag, "alert('保存成功!');window.location='SubPages" + this.Request.Url.Query + "';");
                    }
                    RoadFlow.Platform.AppLibraryButtons1 appLibraryButtons1_1 = new RoadFlow.Platform.AppLibraryButtons1();
                    string str4 = this.Request.Form["buttonindex"] ?? "";
                    List <RoadFlow.Data.Model.AppLibraryButtons1> allByAppId             = appLibraryButtons1_1.GetAllByAppID(model1.ID);
                    List <RoadFlow.Data.Model.AppLibraryButtons1> appLibraryButtons1List = new List <RoadFlow.Data.Model.AppLibraryButtons1>();
                    char[] chArray = new char[1] {
                        ','
                    };
                    foreach (string str5 in str4.Split(chArray))
                    {
                        string index = str5;
                        string str6  = this.Request.Form["button_" + index];
                        string str7  = this.Request.Form["buttonname_" + index];
                        string str8  = this.Request.Form["buttonevents_" + index];
                        string str9  = this.Request.Form["buttonico_" + index];
                        string str10 = this.Request.Form["showtype_" + index];
                        string str11 = this.Request.Form["buttonsort_" + index];
                        if (!str7.IsNullOrEmpty() && !str8.IsNullOrEmpty())
                        {
                            RoadFlow.Data.Model.AppLibraryButtons1 model2 = allByAppId.Find((Predicate <RoadFlow.Data.Model.AppLibraryButtons1>)(p => p.ID == index.ToGuid()));
                            bool flag2 = false;
                            if (model2 == null)
                            {
                                flag2     = true;
                                model2    = new RoadFlow.Data.Model.AppLibraryButtons1();
                                model2.ID = Guid.NewGuid();
                            }
                            else
                            {
                                appLibraryButtons1List.Add(model2);
                            }
                            model2.AppLibraryID = model1.ID;
                            if (str6.IsGuid())
                            {
                                model2.ButtonID = new Guid?(str6.ToGuid());
                            }
                            model2.Events   = str8;
                            model2.Ico      = str9;
                            model2.Name     = str7.Trim1();
                            model2.Sort     = str11.ToInt(0);
                            model2.ShowType = str10.ToInt(0);
                            model2.Type     = 0;
                            if (flag2)
                            {
                                appLibraryButtons1_1.Add(model2);
                            }
                            else
                            {
                                appLibraryButtons1_1.Update(model2);
                            }
                        }
                    }
                    foreach (RoadFlow.Data.Model.AppLibraryButtons1 appLibraryButtons1_2 in allByAppId)
                    {
                        RoadFlow.Data.Model.AppLibraryButtons1 sub1 = appLibraryButtons1_2;
                        if (appLibraryButtons1List.Find((Predicate <RoadFlow.Data.Model.AppLibraryButtons1>)(p => p.ID == sub1.ID)) == null)
                        {
                            appLibraryButtons1_1.Delete(sub1.ID);
                        }
                    }
                    transactionScope.Complete();
                    appLibraryButtons1_1.ClearCache();
                    appLibrarySubPages.ClearCache();
                }
            }
            if (model1 == null)
            {
                model1              = new RoadFlow.Data.Model.AppLibrarySubPages();
                model1.ID           = Guid.Empty;
                model1.AppLibraryID = this.Request.QueryString["id"].ToGuid();
            }
            return((ActionResult)this.View((object)model1));
        }
コード例 #5
0
ファイル: UserTypeOps.cs プロジェクト: dearman/iron-python
 private static CallSite <Func <CallSite, CodeContext, object, string, object> > MakeGetAttrSite(CodeContext context)
 {
     return(CallSite <Func <CallSite, CodeContext, object, string, object> > .Create(
                PythonContext.GetContext(context).InvokeOne
                ));
 }
コード例 #6
0
        public ActionResult Edit(FormCollection collection)
        {
            RoadFlow.Platform.WorkFlowDelegation   workFlowDelegation1 = new RoadFlow.Platform.WorkFlowDelegation();
            RoadFlow.Data.Model.WorkFlowDelegation model = (RoadFlow.Data.Model.WorkFlowDelegation)null;
            string str1   = this.Request.QueryString["id"];
            string empty1 = string.Empty;
            string empty2 = string.Empty;
            string empty3 = string.Empty;
            string empty4 = string.Empty;
            string empty5 = string.Empty;
            string empty6 = string.Empty;
            bool   flag   = "1" == this.Request.QueryString["isoneself"];
            Guid   test;
            Guid?  nullable1;

            if (str1.IsGuid(out test))
            {
                model = workFlowDelegation1.Get(test);
                if (model != null)
                {
                    nullable1 = model.FlowID;
                    empty5    = nullable1.ToString();
                }
            }
            string oldXML = model.Serialize();

            if (collection != null)
            {
                string id1  = this.Request.Form["UserID"];
                string id2  = this.Request.Form["ToUserID"];
                string str2 = this.Request.Form["StartTime"];
                string str3 = this.Request.Form["EndTime"];
                empty5 = this.Request.Form["FlowID"];
                string str4 = this.Request.Form["Note"];
                int    num  = !str1.IsGuid() ? 1 : 0;
                if (model == null)
                {
                    model    = new RoadFlow.Data.Model.WorkFlowDelegation();
                    model.ID = Guid.NewGuid();
                }
                model.UserID  = flag ? RoadFlow.Platform.Users.CurrentUserID : RoadFlow.Platform.Users.RemovePrefix(id1).ToGuid();
                model.EndTime = str3.ToDateTime();
                if (empty5.IsGuid())
                {
                    model.FlowID = new Guid?(empty5.ToGuid());
                }
                else
                {
                    RoadFlow.Data.Model.WorkFlowDelegation workFlowDelegation2 = model;
                    nullable1 = new Guid?();
                    Guid?nullable2 = nullable1;
                    workFlowDelegation2.FlowID = nullable2;
                }
                model.Note      = str4.IsNullOrEmpty() ? (string)null : str4;
                model.StartTime = str2.ToDateTime();
                model.ToUserID  = RoadFlow.Platform.Users.RemovePrefix(id2).ToGuid();
                model.WriteTime = DateTimeNew.Now;
                if (num != 0)
                {
                    workFlowDelegation1.Add(model);
                    RoadFlow.Platform.Log.Add("添加了工作委托", model.Serialize(), RoadFlow.Platform.Log.Types.流程相关, "", "", (RoadFlow.Data.Model.Users)null);
                }
                else
                {
                    workFlowDelegation1.Update(model);
                    RoadFlow.Platform.Log.Add("修改了工作委托", "", RoadFlow.Platform.Log.Types.流程相关, oldXML, model.Serialize(), (RoadFlow.Data.Model.Users)null);
                }
                workFlowDelegation1.RefreshCache();
                // ISSUE: reference to a compiler-generated field
                if (WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__0 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__0 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "Script", typeof(WorkFlowDelegationController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                    {
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, (string)null)
                    }));
                }
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                object obj = WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__0.Target((CallSite)WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__0, this.ViewBag, "alert('保存成功!');new RoadUI.Window().getOpenerWindow().query();new RoadUI.Window().close();");
            }
            // ISSUE: reference to a compiler-generated field
            if (WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__1 == null)
            {
                // ISSUE: reference to a compiler-generated field
                WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__1 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "FlowOptions", typeof(WorkFlowDelegationController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                {
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null)
                }));
            }
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            object obj1 = WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__1.Target((CallSite)WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__1, this.ViewBag, new RoadFlow.Platform.WorkFlow().GetOptions(empty5));

            RoadFlow.Data.Model.WorkFlowDelegation workFlowDelegation3;
            if (model != null)
            {
                workFlowDelegation3 = model;
            }
            else
            {
                workFlowDelegation3        = new RoadFlow.Data.Model.WorkFlowDelegation();
                workFlowDelegation3.UserID = RoadFlow.Platform.Users.CurrentUserID;
            }
            return((ActionResult)this.View((object)workFlowDelegation3));
        }
コード例 #7
0
        public ActionResult Edit(FormCollection collection)
        {
            string str1 = this.Request.QueryString["id"];
            string str2 = this.Request.QueryString["typeid"];

            RoadFlow.Platform.AppLibrary   appLibrary = new RoadFlow.Platform.AppLibrary();
            RoadFlow.Data.Model.AppLibrary model1     = (RoadFlow.Data.Model.AppLibrary)null;
            if (str1.IsGuid())
            {
                model1 = appLibrary.Get(str1.ToGuid(), false);
            }
            bool   flag1  = !str1.IsGuid();
            string oldXML = string.Empty;
            int    index1;

            if (model1 == null)
            {
                model1    = new RoadFlow.Data.Model.AppLibrary();
                model1.ID = Guid.NewGuid();
                // ISSUE: reference to a compiler-generated field
                if (AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__0 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__0 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "TypeOptions", typeof(AppLibraryController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                    {
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null)
                    }));
                }
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                object obj1 = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__0.Target((CallSite)AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__0, this.ViewBag, new RoadFlow.Platform.AppLibrary().GetTypeOptions(str2));
                // ISSUE: reference to a compiler-generated field
                if (AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__1 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__1 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "OpenOptions", typeof(AppLibraryController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                    {
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null)
                    }));
                }
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                object obj2 = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__1.Target((CallSite)AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__1, this.ViewBag, new RoadFlow.Platform.Dictionary().GetOptionsByCode("appopenmodel", RoadFlow.Platform.Dictionary.OptionValueField.Value, "", "", true));
            }
            else
            {
                oldXML = model1.Serialize();
                // ISSUE: reference to a compiler-generated field
                if (AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__2 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__2 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "TypeOptions", typeof(AppLibraryController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                    {
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null)
                    }));
                }
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                object obj1 = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__2.Target((CallSite)AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__2, this.ViewBag, new RoadFlow.Platform.AppLibrary().GetTypeOptions(model1.Type.ToString()));
                // ISSUE: reference to a compiler-generated field
                if (AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__3 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__3 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "OpenOptions", typeof(AppLibraryController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                    {
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null)
                    }));
                }
                // ISSUE: reference to a compiler-generated field
                Func <CallSite, object, string, object> target = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__3.Target;
                // ISSUE: reference to a compiler-generated field
                CallSite <Func <CallSite, object, string, object> > p3 = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__3;
                object viewBag = this.ViewBag;
                RoadFlow.Platform.Dictionary dictionary = new RoadFlow.Platform.Dictionary();
                string code = "appopenmodel";
                int    num1 = 3;
                index1 = model1.OpenMode;
                string str3          = index1.ToString();
                string attr          = "";
                int    num2          = 1;
                string optionsByCode = dictionary.GetOptionsByCode(code, (RoadFlow.Platform.Dictionary.OptionValueField)num1, str3, attr, num2 != 0);
                object obj2          = target((CallSite)p3, viewBag, optionsByCode);
            }
            if (collection != null)
            {
                string str3  = collection["title"];
                string str4  = collection["address"];
                string str5  = collection["openModel"];
                string str6  = collection["width"];
                string str7  = collection["height"];
                string str8  = collection["Params"];
                string str9  = collection["Note"];
                string str10 = collection["Ico"];
                string str11 = collection["IcoColor"];
                string str12 = collection["type"];
                model1.Address  = str4.Trim();
                model1.Height   = str7.ToIntOrNull();
                model1.Note     = str9;
                model1.OpenMode = str5.ToInt();
                model1.Params   = str8;
                model1.Title    = str3;
                model1.Type     = str12.ToGuid();
                model1.Width    = str6.ToIntOrNull();
                model1.Ico      = str10.IsNullOrEmpty() ? (string)null : str10;
                model1.Color    = str11.IsNullOrEmpty() ? (string)null : str11.Trim();
                string str13 = this.Request.QueryString["pagesize"];
                string str14 = this.Request.QueryString["pagenumber"];
                using (TransactionScope transactionScope = new TransactionScope())
                {
                    if (flag1)
                    {
                        appLibrary.Add(model1);
                        RoadFlow.Platform.Log.Add("添加了应用程序库", model1.Serialize(), RoadFlow.Platform.Log.Types.菜单权限, "", "", (RoadFlow.Data.Model.Users)null);
                        // ISSUE: reference to a compiler-generated field
                        if (AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__4 == null)
                        {
                            // ISSUE: reference to a compiler-generated field
                            AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__4 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "Script", typeof(AppLibraryController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                            {
                                CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                                CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null)
                            }));
                        }
                        // ISSUE: reference to a compiler-generated field
                        // ISSUE: reference to a compiler-generated field
                        object obj = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__4.Target((CallSite)AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__4, this.ViewBag, "alert('添加成功!');new RoadUI.Window().reloadOpener(undefined,undefined,\"query('" + str13 + "','" + str14 + "')\");new RoadUI.Window().close();");
                    }
                    else
                    {
                        appLibrary.Update(model1);
                        RoadFlow.Platform.Log.Add("修改了应用程序库", "", RoadFlow.Platform.Log.Types.菜单权限, oldXML, model1.Serialize(), (RoadFlow.Data.Model.Users)null);
                        // ISSUE: reference to a compiler-generated field
                        if (AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__5 == null)
                        {
                            // ISSUE: reference to a compiler-generated field
                            AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__5 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "Script", typeof(AppLibraryController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                            {
                                CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                                CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null)
                            }));
                        }
                        // ISSUE: reference to a compiler-generated field
                        // ISSUE: reference to a compiler-generated field
                        object obj = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__5.Target((CallSite)AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__5, this.ViewBag, "alert('修改成功!');new RoadUI.Window().reloadOpener(undefined,undefined,\"query('" + str13 + "','" + str14 + "')\");new RoadUI.Window().close();");
                    }
                    RoadFlow.Platform.AppLibraryButtons1 appLibraryButtons1_1 = new RoadFlow.Platform.AppLibraryButtons1();
                    string str15 = this.Request.Form["buttonindex"] ?? "";
                    List <RoadFlow.Data.Model.AppLibraryButtons1> allByAppId             = appLibraryButtons1_1.GetAllByAppID(model1.ID);
                    List <RoadFlow.Data.Model.AppLibraryButtons1> appLibraryButtons1List = new List <RoadFlow.Data.Model.AppLibraryButtons1>();
                    char[] chArray = new char[1] {
                        ','
                    };
                    string[] strArray = str15.Split(chArray);
                    for (index1 = 0; index1 < strArray.Length; ++index1)
                    {
                        string index = strArray[index1];
                        string str16 = this.Request.Form["button_" + index];
                        string str17 = this.Request.Form["buttonname_" + index];
                        string str18 = this.Request.Form["buttonevents_" + index];
                        string str19 = this.Request.Form["buttonico_" + index];
                        string str20 = this.Request.Form["showtype_" + index];
                        string str21 = this.Request.Form["buttonsort_" + index];
                        if (!str17.IsNullOrEmpty() && !str18.IsNullOrEmpty())
                        {
                            RoadFlow.Data.Model.AppLibraryButtons1 model2 = allByAppId.Find((Predicate <RoadFlow.Data.Model.AppLibraryButtons1>)(p => p.ID == index.ToGuid()));
                            bool flag2 = false;
                            if (model2 == null)
                            {
                                flag2     = true;
                                model2    = new RoadFlow.Data.Model.AppLibraryButtons1();
                                model2.ID = Guid.NewGuid();
                            }
                            else
                            {
                                appLibraryButtons1List.Add(model2);
                            }
                            model2.AppLibraryID = model1.ID;
                            if (str16.IsGuid())
                            {
                                model2.ButtonID = new Guid?(str16.ToGuid());
                            }
                            model2.Events   = str18;
                            model2.Ico      = str19;
                            model2.Name     = str17.Trim1();
                            model2.Sort     = str21.ToInt(0);
                            model2.ShowType = str20.ToInt(0);
                            model2.Type     = 0;
                            if (flag2)
                            {
                                appLibraryButtons1_1.Add(model2);
                            }
                            else
                            {
                                appLibraryButtons1_1.Update(model2);
                            }
                        }
                    }
                    foreach (RoadFlow.Data.Model.AppLibraryButtons1 appLibraryButtons1_2 in allByAppId)
                    {
                        RoadFlow.Data.Model.AppLibraryButtons1 sub = appLibraryButtons1_2;
                        if (appLibraryButtons1List.Find((Predicate <RoadFlow.Data.Model.AppLibraryButtons1>)(p => p.ID == sub.ID)) == null)
                        {
                            appLibraryButtons1_1.Delete(sub.ID);
                        }
                    }
                    transactionScope.Complete();
                    appLibraryButtons1_1.ClearCache();
                }
                new RoadFlow.Platform.Menu().ClearAllDataTableCache();
                new RoadFlow.Platform.WorkFlow().ClearStartFlowsCache();
                appLibrary.ClearCache();
            }
            return((ActionResult)this.View((object)model1));
        }
コード例 #8
0
 public ActionResult ShortcutSet(FormCollection collection)
 {
     RoadFlow.Platform.UserShortcut userShortcut = new RoadFlow.Platform.UserShortcut();
     if (collection != null)
     {
         if (!this.Request.Form["issort"].IsNullOrEmpty())
         {
             string[] strArray = (this.Request.Form["sort"] ?? "").Split(',');
             for (int index = 0; index < strArray.Length; ++index)
             {
                 RoadFlow.Data.Model.UserShortcut model = userShortcut.Get(strArray[index].ToGuid());
                 if (model != null)
                 {
                     model.Sort = index;
                     userShortcut.Update(model);
                 }
             }
             // ISSUE: reference to a compiler-generated field
             if (UserInfoController.\u003C\u003Eo__5.\u003C\u003Ep__0 == null)
             {
                 // ISSUE: reference to a compiler-generated field
                 UserInfoController.\u003C\u003Eo__5.\u003C\u003Ep__0 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "script", typeof(UserInfoController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                 {
                     CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                     CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, (string)null)
                 }));
             }
             // ISSUE: reference to a compiler-generated field
             // ISSUE: reference to a compiler-generated field
             object obj = UserInfoController.\u003C\u003Eo__5.\u003C\u003Ep__0.Target((CallSite)UserInfoController.\u003C\u003Eo__5.\u003C\u003Ep__0, this.ViewBag, "alert('排序保存成功!');window.location=window.location;");
         }
         else
         {
             Guid   currentUserId = RoadFlow.Platform.Users.CurrentUserID;
             string str1          = this.Request.Form["menuid"] ?? "";
             using (TransactionScope transactionScope = new TransactionScope())
             {
                 userShortcut.DeleteByUserID(currentUserId);
                 int    num     = 0;
                 string str2    = str1;
                 char[] chArray = new char[1] {
                     ','
                 };
                 foreach (string str3 in str2.Split(chArray))
                 {
                     if (str3.IsGuid())
                     {
                         userShortcut.Add(new RoadFlow.Data.Model.UserShortcut()
                         {
                             ID     = Guid.NewGuid(),
                             MenuID = str3.ToGuid(),
                             Sort   = num++,
                             UserID = currentUserId
                         });
                     }
                 }
                 transactionScope.Complete();
                 // ISSUE: reference to a compiler-generated field
                 if (UserInfoController.\u003C\u003Eo__5.\u003C\u003Ep__1 == null)
                 {
                     // ISSUE: reference to a compiler-generated field
                     UserInfoController.\u003C\u003Eo__5.\u003C\u003Ep__1 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "script", typeof(UserInfoController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                     {
                         CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                         CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, (string)null)
                     }));
                 }
                 // ISSUE: reference to a compiler-generated field
                 // ISSUE: reference to a compiler-generated field
                 object obj = UserInfoController.\u003C\u003Eo__5.\u003C\u003Ep__1.Target((CallSite)UserInfoController.\u003C\u003Eo__5.\u003C\u003Ep__1, this.ViewBag, "alert('保存成功!');window.location=window.location;");
             }
         }
         userShortcut.ClearCache();
     }
     return((ActionResult)this.View());
 }
コード例 #9
0
        private static ValueTypeAccessor CreateGetMethodForValueType(PropertyInfo prop, Type type)
        {
            var binder = Microsoft.CSharp.RuntimeBinder.Binder.GetMember(CSharpBinderFlags.None, prop.Name, type, new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) });

            return(new ValueTypeAccessor(CallSite <Func <CallSite, object, object> > .Create(binder)));
        }
コード例 #10
0
        /// <summary>
        /// Generates stub to receive the CLR call and then call the dynamic language code.
        /// </summary>
        private object[] EmitClrCallStub(ILGen cg)
        {
            List <ReturnFixer> fixers = new List <ReturnFixer>(0);

            // Create strongly typed return type from the site.
            // This will, among other things, generate tighter code.
            Type[] siteTypes = MakeSiteSignature();

            CallSite callSite = CallSite.Create(DynamicSiteHelpers.MakeCallSiteDelegate(siteTypes), _invokeBinder);
            Type     siteType = callSite.GetType();

            Type     convertSiteType = null;
            CallSite convertSite     = null;

            if (_returnType != typeof(void))
            {
                convertSite     = CallSite.Create(DynamicSiteHelpers.MakeCallSiteDelegate(typeof(object), _returnType), _convertBinder);
                convertSiteType = convertSite.GetType();
            }

            // build up constants array
            object[]  constants = new object[] { TargetPlaceHolder, CallSitePlaceHolder, ConvertSitePlaceHolder };
            const int TargetIndex = 0, CallSiteIndex = 1, ConvertSiteIndex = 2;

            LocalBuilder convertSiteLocal = null;
            FieldInfo    convertTarget    = null;

            if (_returnType != typeof(void))
            {
                // load up the conversesion logic on the stack
                convertSiteLocal = cg.DeclareLocal(convertSiteType);
                EmitConstantGet(cg, ConvertSiteIndex, convertSiteType);

                cg.Emit(OpCodes.Dup);
                cg.Emit(OpCodes.Stloc, convertSiteLocal);

                convertTarget = convertSiteType.GetField("Target");
                cg.EmitFieldGet(convertTarget);
                cg.Emit(OpCodes.Ldloc, convertSiteLocal);
            }

            // load up the invoke logic on the stack
            LocalBuilder site = cg.DeclareLocal(siteType);

            EmitConstantGet(cg, CallSiteIndex, siteType);
            cg.Emit(OpCodes.Dup);
            cg.Emit(OpCodes.Stloc, site);

            FieldInfo target = siteType.GetField("Target");

            cg.EmitFieldGet(target);
            cg.Emit(OpCodes.Ldloc, site);

            EmitConstantGet(cg, TargetIndex, typeof(object));

            for (int i = 0; i < _parameters.Length; i++)
            {
                if (_parameters[i].ParameterType.IsByRef)
                {
                    ReturnFixer rf = ReturnFixer.EmitArgument(cg, i + 1, _parameters[i].ParameterType);
                    if (rf != null)
                    {
                        fixers.Add(rf);
                    }
                }
                else
                {
                    cg.EmitLoadArg(i + 1);
                }
            }

            // emit the invoke for the call
            cg.EmitCall(target.FieldType, "Invoke");

            // emit the invoke for the convert
            if (_returnType == typeof(void))
            {
                cg.Emit(OpCodes.Pop);
            }
            else
            {
                cg.EmitCall(convertTarget.FieldType, "Invoke");
            }

            // fixup any references
            foreach (ReturnFixer rf in fixers)
            {
                rf.FixReturn(cg);
            }

            cg.Emit(OpCodes.Ret);
            return(constants);
        }
コード例 #11
0
        private static object BindParameter(DisplayContext displayContext, ParameterInfo parameter)
        {
            if (String.Equals(parameter.Name, "Shape", StringComparison.OrdinalIgnoreCase))
            {
                return(displayContext.Value);
            }

            if (String.Equals(parameter.Name, "DisplayAsync", StringComparison.OrdinalIgnoreCase))
            {
                return(displayContext.DisplayAsync);
            }

            if (String.Equals(parameter.Name, "New", StringComparison.OrdinalIgnoreCase))
            {
                return(displayContext.ServiceProvider.GetService <IShapeFactory>());
            }

            if (String.Equals(parameter.Name, "ShapeFactory", StringComparison.OrdinalIgnoreCase))
            {
                return(displayContext.ServiceProvider.GetService <IShapeFactory>());
            }

            if (String.Equals(parameter.Name, "Html", StringComparison.OrdinalIgnoreCase))
            {
                var viewContextAccessor = displayContext.ServiceProvider.GetRequiredService <ViewContextAccessor>();
                var viewContext         = viewContextAccessor.ViewContext;

                return(MakeHtmlHelper(viewContext, viewContext.ViewData));
            }

            if (String.Equals(parameter.Name, "DisplayContext", StringComparison.OrdinalIgnoreCase))
            {
                return(displayContext);
            }

            if (String.Equals(parameter.Name, "Url", StringComparison.OrdinalIgnoreCase) && typeof(IUrlHelper).IsAssignableFrom(parameter.ParameterType))
            {
                var viewContextAccessor = displayContext.ServiceProvider.GetRequiredService <ViewContextAccessor>();
                var viewContext         = viewContextAccessor.ViewContext;

                var urlHelperFactory = displayContext.ServiceProvider.GetService <IUrlHelperFactory>();
                return(urlHelperFactory.GetUrlHelper(viewContext));
            }

            if (String.Equals(parameter.Name, "Output", StringComparison.OrdinalIgnoreCase) && parameter.ParameterType == typeof(TextWriter))
            {
                throw new InvalidOperationException("Output is no more a valid Shape method parameter. Return an IHtmlContent instead.");
            }

            if (String.Equals(parameter.Name, "Output", StringComparison.OrdinalIgnoreCase) && parameter.ParameterType == typeof(Action <object>))
            {
                throw new InvalidOperationException("Output is no more a valid Shape method parameter. Return an IHtmlContent instead.");
            }

            var getter = _getters.GetOrAdd(parameter.Name, n =>
                                           CallSite <Func <CallSite, object, dynamic> > .Create(
                                               Microsoft.CSharp.RuntimeBinder.Binder.GetMember(
                                                   CSharpBinderFlags.None, n, null, new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));

            object result = getter.Target(getter, displayContext.Value);

            if (result == null)
            {
                return(null);
            }

            if (parameter.ParameterType.IsAssignableFrom(result.GetType()))
            {
                return(result);
            }

            // Specific implementation for DateTimes
            if (result.GetType() == typeof(string) && (parameter.ParameterType == typeof(DateTime) || parameter.ParameterType == typeof(DateTime?)))
            {
                return(DateTime.Parse((string)result));
            }

            return(Convert.ChangeType(result, parameter.ParameterType));
        }
コード例 #12
0
ファイル: CallSiteTests.cs プロジェクト: rsumner31/corefx2
 public void NullBinder()
 {
     AssertExtensions.Throws <ArgumentNullException>("binder", () => CallSite <Func <CallSite, object, object> > .Create(null));
 }
コード例 #13
0
ファイル: CallSiteTests.cs プロジェクト: rsumner31/corefx2
 public void NonGenericCreateNullBinder()
 {
     AssertExtensions.Throws <ArgumentNullException>("binder", () => CallSite.Create(typeof(Func <string>), null));
 }
コード例 #14
0
ファイル: CallSiteTests.cs プロジェクト: rsumner31/corefx2
        public void NonGenericCreateNullType()
        {
            CallSiteBinder binder = new CallSiteBinderDefaultBehaviourTests.NopCallSiteBinder();

            AssertExtensions.Throws <ArgumentNullException>("delegateType", () => CallSite.Create(null, binder));
        }
コード例 #15
0
        private void InjectBtn_Click(object sender, EventArgs e)
        {
            if (WRDAPICheck.Value == true)
            {
                ExploitAPI.ExploitAPI.LaunchExploit();
                Console.WriteLine("Injected WeAreDevs API.");
                MessageBox.Show("Injected WeAreDevs API.", "Generic Exploit Loader", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (APIMCheck.Value == true)
            {
                ApiModule.ApiModule.LaunchExploit();
                Console.WriteLine("Injected ApiModule.");
                MessageBox.Show("Injected ApiModule.", "Generic Exploit Loader", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (SkidsploitOnOff.Value == true)
            {
                MessageBox.Show("Not supported at this build!, please wait for a newer build that support Skisploit API", "Generic Exploit Loader", MessageBoxButtons.OK, MessageBoxIcon.Error);

                /*
                 * RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\\\SkisploitAuth", true);
                 * bool flag3 = registryKey == null;
                 * if (flag3)
                 * {
                 *  registryKey = Registry.CurrentUser.CreateSubKey("SOFTWARE\\\\SkisploitAuth");
                 *  registryKey.SetValue("Auth", "");
                 * }
                 * registryKey.SetValue("Auth", "382fe18b3029c5d86349cd91d0b57410158afac49ba9d3935687d84edd0f97b7");
                 * RedBoy.Functions.Inject();
                 * Thread.Sleep(3000);
                 * try
                 * {
                 *  new WebClient().DownloadFile("https://cdn.discordapp.com/attachments/591382108279406592/591382413662486533/redboyscripts-obfuscated.lua", "script.txt");
                 *  string script = File.ReadAllText("script.txt");
                 *  File.Delete("script.txt");
                 *  RedBoy.NamedPipes.LuaPipe(script);
                 * }
                 * catch
                 * {
                 * }
                 * Console.WriteLine("Injected RedBoy.");
                 * MessageBox.Show("Injected Skisploit API.", "Generic Exploit Loader", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 */// Need to find more about RedBoy exe to understand how.
            }
            else if (HaxonSwitch.Value == true)
            {
                Functions.Inject();
                Console.WriteLine("Injected Haxon-[Generic].");
                MessageBox.Show("Injected Haxon.", "Generic Exploit Loader", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (AwSwitch.Value == true)
            {
                AwApi.Attach();
                Console.WriteLine("Injected AutisticWare.");
                MessageBox.Show("Injected AutisticWare.", "Generic Exploit Loader", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (Ax0nSwitch.Value == true)
            {
                Functions.Inject();
                Console.WriteLine("Injected Axon-Generic.");
                MessageBox.Show("Injected Axon.", "Generic Exploit Loader", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (sirhurtswitch.Value == true)
            {
                if (value1 == null)
                {
                    value1 = CallSite <Func <CallSite, object, bool> > .Create(Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsTrue, typeof(DefaultForm), new CSharpArgumentInfo[]
                    {
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
                    }));
                }
                Func <CallSite, object, bool> target = value1.Target;
                CallSite p__ = value1;
                if (value2 == null)
                {
                    value2 = CallSite <Func <CallSite, object, object> > .Create(Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.Not, typeof(DefaultForm), new CSharpArgumentInfo[]
                    {
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
                    }));
                }
                object obj = value2.Target(value2, fakebool);
                if (value3 == null)
                {
                    value3 = CallSite <Func <CallSite, object, bool> > .Create(Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsFalse, typeof(DefaultForm), new CSharpArgumentInfo[]
                    {
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
                    }));
                }
                object arg;
                if (!value3.Target(value3, obj))
                {
                    if (value4 == null)
                    {
                        value4 = CallSite <Func <CallSite, object, bool, object> > .Create(Binder.BinaryOperation(CSharpBinderFlags.BinaryOperationLogical, ExpressionType.And, typeof(DefaultForm), new CSharpArgumentInfo[]
                        {
                            CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null),
                            CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null)
                        }));
                    }
                    arg = value4.Target(value4, obj, intPtr != IntPtr.Zero);
                }
                else
                {
                    arg = obj;
                }
                if (target(p__, arg))
                {
                    if (fakebool)
                    {
                        Thread.Sleep(3000);
                    }
                    int num = 0;
                    try
                    {
                        num      = Inject();
                        fakebool = true;
                        Console.WriteLine("Injected SirHurt-[Generic].");
                        MessageBox.Show("Injected SirHurt.", "Generic Exploit Loader", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(string.Format("An error occured with injecting SirHurt: %s", ex.Message), "SirHurt V2");
                    }
                    if (num != 0)
                    {
                        fakebool = true;
                        return;
                    }
                    DefaultForm.GetWindowThreadProcessId(intPtr, out this.attachedID);
                    fakebool = true;
                }
            }
            else
            {
                Console.WriteLine("Couldn't Inject. Ex: User hasnt choosed mode to inject.");
                MessageBox.Show("Please choose a mode to inject.", "Generic Exploit Loader", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #16
0
 public MethodBinding(PythonInvokeBinder binder)
 {
     _site = CallSite <Func <CallSite, CodeContext, object, object, object> > .Create(binder);
 }
コード例 #17
0
        private void BunifuExecLua_Click(object sender, EventArgs e)
        {
            switch (ExeMode)
            {
            case 1:
                if (WRDAPICheck.Value == true)
                {
                    ExploitAPI.ExploitAPI.SendLuaScript(TextArea.Text);
                    Console.WriteLine("Executed script using WeAreDevs API");
                }
                else if (APIMCheck.Value == true)
                {
                    ApiModule.ApiModule.ExecuteScript(TextArea.Text);
                    Console.WriteLine("Executed script using ApiModule");
                }
                else if (SkidsploitOnOff.Value == true)
                {
                    MessageBox.Show("Not supported at this build!, please wait for a newer build that support Skisploit API", "Generic Exploit Loader", MessageBoxButtons.OK, MessageBoxIcon.Error);

                    /*RedBoy.NamedPipes.LuaPipe(TextArea.Text);
                     * Console.WriteLine("Executed script using RedBoy");
                     */// We dont need this since we can't inject Rb.
                }
                else if (HaxonSwitch.Value == true)
                {
                    NamedPipes.LuaPipe(TextArea.Text);
                    Console.WriteLine("Executed script using Haxon-[Generic]");
                }
                else if (AwSwitch.Value == true)
                {
                    AwApi.Execute(TextArea.Text);
                    Console.WriteLine("Executed script using AutisticWare");
                }
                else if (Ax0nSwitch.Value == true)
                {
                    NamedPipes.LuaPipe(TextArea.Text);
                    Console.WriteLine("Executed script using Axon-Generic");
                }
                else if (sirhurtswitch.Value == true)
                {
                    NamedPipes.LuaPipe(TextArea.Text);
                    Console.WriteLine("Executed script using SirHurt-[Generic]");
                }
                else
                {
                    Console.WriteLine("Can't execute script, user hasn't choosed mode yet.");
                    MessageBox.Show("Please choose a mode to execute.", "Generic Exploit Loader", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                break;

            case 2:
                HtmlDocument document   = this.MonacoEditor.Document;
                string       scriptName = "GetText";
                object[]     array      = new string[0];
                object[]     args       = array;
                if (WRDAPICheck.Value == true)
                {
                    ExploitAPI.ExploitAPI.SendLuaScript(document.InvokeScript(scriptName, args).ToString());
                    Console.WriteLine("Executed script using WeAreDevs API");
                }
                else if (APIMCheck.Value == true)
                {
                    ApiModule.ApiModule.ExecuteScript(document.InvokeScript(scriptName, args).ToString());
                    Console.WriteLine("Executed script using ApiModule");
                }
                else if (SkidsploitOnOff.Value == true)
                {
                    MessageBox.Show("Not supported at this build!, please wait for a newer build that support Skisploit API", "Generic Exploit Loader", MessageBoxButtons.OK, MessageBoxIcon.Error);

                    /*
                     * RedBoy.NamedPipes.LuaPipe(document.InvokeScript(scriptName, args).ToString());
                     * Console.WriteLine("Executed script using RedBoy");
                     */// Not working since we cant inject rb.
                }
                else if (HaxonSwitch.Value == true)
                {
                    NamedPipes.LuaPipe(document.InvokeScript(scriptName, args).ToString());
                    Console.WriteLine("Executed script using Haxon-[Generic]");
                }
                else if (AwSwitch.Value == true)
                {
                    AwApi.Execute(document.InvokeScript(scriptName, args).ToString());
                    Console.WriteLine("Executed script using AutisticWare");
                }
                else if (Ax0nSwitch.Value == true)
                {
                    NamedPipes.LuaPipe(document.InvokeScript(scriptName, args).ToString());
                    Console.WriteLine("Executed script using Axon-Generic");
                }
                else if (sirhurtswitch.Value == true)
                {
                    if (ara_ara == null)
                    {
                        ara_ara = CallSite <Action <CallSite, Type, object> > .Create(Binder.InvokeMember(CSharpBinderFlags.ResultDiscarded, "SirHurtPipe", null, typeof(DefaultForm), new CSharpArgumentInfo[]
                        {
                            CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.IsStaticType, null),
                            CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
                        }));
                    }
                    ara_ara.Target(ara_ara, typeof(DefaultForm), document.InvokeScript(scriptName, args).ToString());
                    Console.WriteLine("Executed script using SirHurt");
                }
                else
                {
                    Console.WriteLine("Can't execute script, user hasn't choosed mode yet.");
                    MessageBox.Show("Please choose a mode to execute.", "Generic Exploit Loader", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                break;
            }
        }
コード例 #18
0
 private static CallSite <Func <CallSite, object, object> > CustomizeClient(string ident)
 {
     //Discarded unreachable code: IL_0002
     //IL_0003: Incompatible stack heights: 0 vs 1
     return(CallSite <Func <CallSite, object, object> > .Create(new ProxyBroadcasterFilter((GetMemberBinder)TokenEventEntry.GlobalComposer.AddIssuer(ident, typeof(TokenEventEntry)))));
 }
コード例 #19
0
 public override CallSite MakeSite()
 {
     return(CallSite.Create(DelegateType, Binder));
 }
コード例 #20
0
 private static CallSite <Func <CallSite, object, object, object> > QueryClient(string spec)
 {
     //Discarded unreachable code: IL_0002
     //IL_0003: Incompatible stack heights: 0 vs 1
     return(CallSite <Func <CallSite, object, object, object> > .Create(new InitializerComposer((SetMemberBinder)TokenEventEntry.GlobalComposer.EnableIssuer(spec, typeof(TokenEventEntry)))));
 }
コード例 #21
0
        public ActionResult List()
        {
            string str1 = this.Request.QueryString["appid"];
            string str2 = this.Request.QueryString["tabid"];
            string str3 = this.Request.QueryString["typeid"];
            string str4 = string.Format("&appid={0}&tabid={1}&typeid={2}", (object)this.Request.QueryString["appid"], (object)this.Request.QueryString["tabid"], (object)this.Request.QueryString["typeid"]);

            // ISSUE: reference to a compiler-generated field
            if (AppLibraryController.\u003C\u003Eo__2.\u003C\u003Ep__0 == null)
            {
                // ISSUE: reference to a compiler-generated field
                AppLibraryController.\u003C\u003Eo__2.\u003C\u003Ep__0 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "Query1", typeof(AppLibraryController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                {
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null)
                }));
            }
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            object obj1 = AppLibraryController.\u003C\u003Eo__2.\u003C\u003Ep__0.Target((CallSite)AppLibraryController.\u003C\u003Eo__2.\u003C\u003Ep__0, this.ViewBag, str4);

            // ISSUE: reference to a compiler-generated field
            if (AppLibraryController.\u003C\u003Eo__2.\u003C\u003Ep__1 == null)
            {
                // ISSUE: reference to a compiler-generated field
                AppLibraryController.\u003C\u003Eo__2.\u003C\u003Ep__1 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "TypeID", typeof(AppLibraryController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                {
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null)
                }));
            }
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            object obj2 = AppLibraryController.\u003C\u003Eo__2.\u003C\u003Ep__1.Target((CallSite)AppLibraryController.\u003C\u003Eo__2.\u003C\u003Ep__1, this.ViewBag, str3);

            // ISSUE: reference to a compiler-generated field
            if (AppLibraryController.\u003C\u003Eo__2.\u003C\u003Ep__2 == null)
            {
                // ISSUE: reference to a compiler-generated field
                AppLibraryController.\u003C\u003Eo__2.\u003C\u003Ep__2 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "AppID", typeof(AppLibraryController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                {
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null)
                }));
            }
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            object obj3 = AppLibraryController.\u003C\u003Eo__2.\u003C\u003Ep__2.Target((CallSite)AppLibraryController.\u003C\u003Eo__2.\u003C\u003Ep__2, this.ViewBag, str1);

            // ISSUE: reference to a compiler-generated field
            if (AppLibraryController.\u003C\u003Eo__2.\u003C\u003Ep__3 == null)
            {
                // ISSUE: reference to a compiler-generated field
                AppLibraryController.\u003C\u003Eo__2.\u003C\u003Ep__3 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "TabID", typeof(AppLibraryController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                {
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null)
                }));
            }
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            object obj4 = AppLibraryController.\u003C\u003Eo__2.\u003C\u003Ep__3.Target((CallSite)AppLibraryController.\u003C\u003Eo__2.\u003C\u003Ep__3, this.ViewBag, str2);

            return((ActionResult)this.View());
        }
コード例 #22
0
        /// <summary>
        /// Gets the value dynamically.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <param name="dynamicMemberName">Name of the dynamic member.</param>
        /// <returns></returns>
        public static object GetValueDynamically(object entity, string dynamicMemberName)
        {
            Func <string, CallSite <Func <CallSite, object, object> > > valueFactory = s => CallSite <Func <CallSite, object, object> > .Create(
                Binder.GetMember(
                    CSharpBinderFlags.None,
                    dynamicMemberName,
                    null,
                    new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) }
                    ));

            var callsite = callsitesCache.GetOrAdd(dynamicMemberName, valueFactory);

            return(callsite.Target(callsite, entity));
        }
コード例 #23
0
 public static Instruction Factory(CallSiteBinder binder)
 {
     return(new DynamicInstruction <T0, T1, T2, T3, T4, T5, TRet>(CallSite <Func <CallSite, T0, T1, T2, T3, T4, T5, TRet> > .Create(binder)));
 }
コード例 #24
0
        public static K TryEvalCast <T, K>(T obj, Type type, CSharpBinderFlags kind, Type accessibilityContext)
        {
            var site = CallSite <Func <CallSite, T, K> > .Create(Binder.Convert(kind, type, accessibilityContext));

            return(site.Target(site, obj));
        }
コード例 #25
0
ファイル: Class4.cs プロジェクト: unionjl/CyberAIO
 // Token: 0x0600004F RID: 79 RVA: 0x00009804 File Offset: 0x00007A04
 public void method_12()
 {
     if (object.Equals(true, (bool)this.jtoken_0["one_checkout"]))
     {
         foreach (JToken jtoken in JObject.Parse(MainWindow.webView_0.QueueScriptCall("JSON.stringify(tasklist)").smethod_0()).Values())
         {
             if (jtoken["profile"].ToString() == this.jtoken_1["profile"].ToString() && jtoken["store"].ToString() == this.jtoken_1["store"].ToString() && jtoken["id"].ToString() != this.jtoken_1["id"].ToString())
             {
                 if (Class4.Class8.callSite_3 == null)
                 {
                     Class4.Class8.callSite_3 = CallSite <Func <CallSite, object, bool> > .Create(Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsTrue, typeof(Class4), new CSharpArgumentInfo[]
                     {
                         CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
                     }));
                 }
                 Func <CallSite, object, bool> target = Class4.Class8.callSite_3.Target;
                 CallSite callSite_ = Class4.Class8.callSite_3;
                 bool     flag;
                 object   arg2;
                 if (flag = MainWindow.dictionary_0.ContainsKey((int)jtoken["id"]))
                 {
                     if (Class4.Class8.callSite_2 == null)
                     {
                         Class4.Class8.callSite_2 = CallSite <Func <CallSite, bool, object, object> > .Create(Binder.BinaryOperation(CSharpBinderFlags.BinaryOperationLogical, ExpressionType.And, typeof(Class4), new CSharpArgumentInfo[]
                         {
                             CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null),
                             CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
                         }));
                     }
                     Func <CallSite, bool, object, object> target2 = Class4.Class8.callSite_2.Target;
                     CallSite callSite_2 = Class4.Class8.callSite_2;
                     bool     arg        = flag;
                     if (Class4.Class8.callSite_1 == null)
                     {
                         Class4.Class8.callSite_1 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.BinaryOperation(CSharpBinderFlags.None, ExpressionType.Equal, typeof(Class4), new CSharpArgumentInfo[]
                         {
                             CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null),
                             CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null)
                         }));
                     }
                     Func <CallSite, object, string, object> target3 = Class4.Class8.callSite_1.Target;
                     CallSite callSite_3 = Class4.Class8.callSite_1;
                     if (Class4.Class8.callSite_0 == null)
                     {
                         Class4.Class8.callSite_0 = CallSite <Func <CallSite, object, object> > .Create(Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(Class4), new CSharpArgumentInfo[]
                         {
                             CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
                         }));
                     }
                     arg2 = target2(callSite_2, arg, target3(callSite_3, Class4.Class8.callSite_0.Target(Class4.Class8.callSite_0, MainWindow.dictionary_0[(int)jtoken["id"]]["product"]), this.jtoken_1["product"].ToString()));
                 }
                 else
                 {
                     arg2 = flag;
                 }
                 if (target(callSite_, arg2))
                 {
                     object arg3 = MainWindow.dictionary_0[(int)jtoken["id"]]["thread"];
                     MainWindow.dictionary_0[(int)jtoken["id"]]["stop"] = true;
                     MainWindow.webView_0.QueueScriptCall(string.Format("updateTable('Stopping...','DARKORANGE',{0},7)", jtoken["id"]));
                     if (Class4.Class8.callSite_4 == null)
                     {
                         Class4.Class8.callSite_4 = CallSite <Action <CallSite, object> > .Create(Binder.InvokeMember(CSharpBinderFlags.ResultDiscarded, "Abort", null, typeof(Class4), new CSharpArgumentInfo[]
                         {
                             CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
                         }));
                     }
                     Class4.Class8.callSite_4.Target(Class4.Class8.callSite_4, arg3);
                     if (Class4.Class8.callSite_5 == null)
                     {
                         Class4.Class8.callSite_5 = CallSite <Action <CallSite, object> > .Create(Binder.InvokeMember(CSharpBinderFlags.ResultDiscarded, "Join", null, typeof(Class4), new CSharpArgumentInfo[]
                         {
                             CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
                         }));
                     }
                     Class4.Class8.callSite_5.Target(Class4.Class8.callSite_5, arg3);
                     MainWindow.dictionary_0.Remove((int)jtoken["id"]);
                     MainWindow.webView_0.QueueScriptCall(string.Format("updateTable('Billing used','red',{0},7)", jtoken["id"]));
                     MainWindow.webView_0.QueueScriptCall(string.Format("updateButton({0},false)", jtoken["id"]));
                 }
             }
         }
     }
 }
コード例 #26
0
 public DynamicCaller(Type type)
 {
     this.type       = type;
     this.indexCache = CallSite <Func <CallSite, object, string, object> > .Create(Binder.GetIndex(CSharpBinderFlags.None, type, new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null) }));
 }
コード例 #27
0
        private static CallSite <Func <CallSite, object, object, object> > CreateCallSiteSetter(string name)
        {
            SetMemberBinder binder = (SetMemberBinder)DynamicUtils.BinderWrapper.SetMember(name, typeof(DynamicUtils));

            return(CallSite <Func <CallSite, object, object, object> > .Create(new NoThrowSetBinderMember(binder)));
        }
コード例 #28
0
ファイル: UserTypeOps.cs プロジェクト: SueDou/python
 private static CallSite <Func <CallSite, CodeContext, object, string, object> > MakeGetAttrSite(CodeContext context)
 {
     return(CallSite <Func <CallSite, CodeContext, object, string, object> > .Create(
                context.LanguageContext.InvokeOne
                ));
 }
コード例 #29
0
        public Dictionary <string, object> ToDictionary()
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            foreach (PropertyDefinition propertyDefinition in this.ObjectSchema.AllProperties)
            {
                object obj;
                if (string.Compare(propertyDefinition.Name, "ObjectState", true) != 0 && string.Compare(propertyDefinition.Name, "ExchangeVersion") != 0 && base.TryGetValueWithoutDefault(propertyDefinition, out obj) && obj != null)
                {
                    if (typeof(QueryableObject).IsAssignableFrom(propertyDefinition.Type))
                    {
                        object arg = obj;
                        SimpleProviderPropertyDefinition simpleProviderPropertyDefinition = propertyDefinition as SimpleProviderPropertyDefinition;
                        if (simpleProviderPropertyDefinition != null)
                        {
                            if (simpleProviderPropertyDefinition.IsMultivalued)
                            {
                                List <Dictionary <string, object> > list = new List <Dictionary <string, object> >();
                                if (QueryableObject.< ToDictionary > o__SiteContainer0.< > p__Site1 == null)
                                {
                                    QueryableObject.< ToDictionary > o__SiteContainer0.< > p__Site1 = CallSite <Func <CallSite, object, IEnumerable> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(IEnumerable), typeof(QueryableObject)));
                                }
                                using (IEnumerator enumerator2 = QueryableObject.< ToDictionary > o__SiteContainer0.< > p__Site1.Target(QueryableObject.< ToDictionary > o__SiteContainer0.< > p__Site1, arg).GetEnumerator())
                                {
                                    while (enumerator2.MoveNext())
                                    {
                                        if (QueryableObject.< ToDictionary > o__SiteContainer0.< > p__Site2 == null)
                                        {
                                            QueryableObject.< ToDictionary > o__SiteContainer0.< > p__Site2 = CallSite <Func <CallSite, object, QueryableObject> > .Create(Binder.Convert(CSharpBinderFlags.ConvertExplicit, typeof(QueryableObject), typeof(QueryableObject)));
                                        }
                                        QueryableObject queryableObject = QueryableObject.< ToDictionary > o__SiteContainer0.< > p__Site2.Target(QueryableObject.< ToDictionary > o__SiteContainer0.< > p__Site2, enumerator2.Current);
                                        list.Add(queryableObject.ToDictionary());
                                    }
                                }
                                dictionary.Add(propertyDefinition.Name, list);
                            }
                            else
                            {
                                if (QueryableObject.< ToDictionary > o__SiteContainer0.< > p__Site3 == null)
                                {
                                    QueryableObject.< ToDictionary > o__SiteContainer0.< > p__Site3 = CallSite <Action <CallSite, Dictionary <string, object>, string, object> > .Create(Binder.InvokeMember(CSharpBinderFlags.ResultDiscarded, "Add", null, typeof(QueryableObject), new CSharpArgumentInfo[]
                                    {
                                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null),
                                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null),
                                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
                                    }));
                                }
                                Action <CallSite, Dictionary <string, object>, string, object> target = QueryableObject.< ToDictionary > o__SiteContainer0.< > p__Site3.Target;
                                CallSite <> p__Site = QueryableObject.< ToDictionary > o__SiteContainer0.< > p__Site3;
                                Dictionary <string, object> arg2 = dictionary;
                                string name = propertyDefinition.Name;
                                if (QueryableObject.< ToDictionary > o__SiteContainer0.< > p__Site4 == null)
                                {
                                    QueryableObject.< ToDictionary > o__SiteContainer0.< > p__Site4 = CallSite <Func <CallSite, object, object> > .Create(Binder.InvokeMember(CSharpBinderFlags.None, "ToDictionary", null, typeof(QueryableObject), new CSharpArgumentInfo[]
                                    {
                                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
                                    }));
                                }
                                target(< > p__Site, arg2, name, QueryableObject.< ToDictionary > o__SiteContainer0.< > p__Site4.Target(QueryableObject.< ToDictionary > o__SiteContainer0.< > p__Site4, arg));
                            }
                        }
                    }
                    else
                    {
                        dictionary.Add(propertyDefinition.Name, obj);
                    }
                }
            }
            return(dictionary);
        }
コード例 #30
0
ファイル: DlrInteropTests.cs プロジェクト: yyyyj/ironruby
        internal static object Invoke(object obj)
        {
            var site = CallSite <Func <CallSite, object, object> > .Create(new MyInvokeBinder(new CallInfo(0)));

            return(site.Target(site, obj));
        }