當前位置: 首頁>>代碼示例>>C#>>正文


C# InvokeMemberBinder.FallbackInvoke方法代碼示例

本文整理匯總了C#中System.Dynamic.InvokeMemberBinder.FallbackInvoke方法的典型用法代碼示例。如果您正苦於以下問題:C# InvokeMemberBinder.FallbackInvoke方法的具體用法?C# InvokeMemberBinder.FallbackInvoke怎麽用?C# InvokeMemberBinder.FallbackInvoke使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Dynamic.InvokeMemberBinder的用法示例。


在下文中一共展示了InvokeMemberBinder.FallbackInvoke方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: BindInvokeMember

        public override DynamicMetaObject BindInvokeMember(InvokeMemberBinder binder, DynamicMetaObject[] args) {
            var result = TryBindGetMember(binder.Name);
            if (result != null) {
                return binder.FallbackInvoke(result, args, null);
            }

            return base.BindInvokeMember(binder, args);
        }
開發者ID:jschementi,項目名稱:iron,代碼行數:8,代碼來源:TypeLibMetaObject.cs

示例2: BindInvokeMember

            public override DynamicMetaObject BindInvokeMember(InvokeMemberBinder binder, DynamicMetaObject[] args) {
                // Generate a tree like:
                //
                // {
                //   object result;
                //   TryInvokeMember(payload, out result)
                //      ? result
                //      : TryGetMember(payload, out result)
                //          ? FallbackInvoke(result)
                //          : fallbackResult
                // }
                //
                // Then it calls FallbackInvokeMember with this tree as the
                // "error", giving the language the option of using this
                // tree or doing .NET binding.
                //
                Fallback fallback = e => binder.FallbackInvokeMember(this, args, e);

                var call = BuildCallMethodWithResult(
                    "TryInvokeMember",
                    binder,
                    DynamicMetaObject.GetExpressions(args),
                    BuildCallMethodWithResult(
                        "TryGetMember",
                        new GetBinderAdapter(binder),
                        NoArgs,
                        fallback(null), 
                        (e) => binder.FallbackInvoke(e, args, null)
                    ),
                    null
                );

                return fallback(call);
            }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:34,代碼來源:DynamicObject.cs

示例3: GenericInvokeMember

        /// <summary>
        /// Transforms an invoke member into a Python GetMember/Invoke.  The caller should
        /// verify that the given attribute is not resolved against a normal .NET class
        /// before calling this.  If it is a normal .NET member then a fallback InvokeMember
        /// is preferred.
        /// </summary>
        internal static DynamicMetaObject/*!*/ GenericInvokeMember(InvokeMemberBinder/*!*/ action, ValidationInfo valInfo, DynamicMetaObject target, DynamicMetaObject/*!*/[]/*!*/ args) {
            if (target.NeedsDeferral()) {
                return action.Defer(args);
            }

            return AddDynamicTestAndDefer(action, 
                action.FallbackInvoke(
                    new DynamicMetaObject(
                        Binders.Get(
                            PythonContext.GetCodeContext(action),
                            PythonContext.GetPythonContext(action),
                            typeof(object),
                            action.Name,
                            target.Expression
                        ),
                        BindingRestrictionsHelpers.GetRuntimeTypeRestriction(target)
                    ),
                    args,
                    null
                ),
                args,
                valInfo
            );
        }
開發者ID:jschementi,項目名稱:iron,代碼行數:30,代碼來源:BindingHelpers.cs

示例4: BindInvokeMember

 public override DynamicMetaObject BindInvokeMember(InvokeMemberBinder binder, DynamicMetaObject[] args) {
     ContractUtils.RequiresNotNull(binder, "binder");
     DynamicMetaObject memberValue = GetDynamicMetaObjectForMember(
         binder.Name, 
         binder.IgnoreCase,
         binder.FallbackInvokeMember(this, args)
     );
     //invoke the member value using the language's binder
     return AddDynamicTestAndDefer(
         binder,
         new DynamicMetaObject[] { this },
         Value.Class,
         null,
         binder.FallbackInvoke(memberValue, args, null)
     );
 }
開發者ID:octavioh,項目名稱:ironruby,代碼行數:16,代碼來源:ExpandoObject.cs

示例5: BindInvokeMember

 public override DynamicMetaObject BindInvokeMember(InvokeMemberBinder binder, DynamicMetaObject[] args)
 {
     return DynamicTryGetMember(binder.Name,
         binder.FallbackInvokeMember(this, args).Expression,
         (tmp) => binder.FallbackInvoke(new DynamicMetaObject(tmp, BindingRestrictions.Empty), args, null).Expression
     );
 }
開發者ID:TerabyteX,項目名稱:main,代碼行數:7,代碼來源:StringDictionaryExpando.cs

示例6: BindInvokeMember

 public override DynamicMetaObject BindInvokeMember(InvokeMemberBinder binder, DynamicMetaObject[] args)
 {
     Fallback fallback = e => binder.FallbackInvokeMember(this, args, e);
     DynamicMetaObject errorSuggestion = this.BuildCallMethodWithResult("TryInvokeMember", binder, GetArgArray(args), this.BuildCallMethodWithResult("TryGetMember", new GetBinderAdapter(binder), NoArgs, fallback(null), e => binder.FallbackInvoke(e, args, null)), null);
     return fallback(errorSuggestion);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:6,代碼來源:DynamicObject.cs

示例7: BindInvokeMember

            public override DynamicMetaObject BindInvokeMember(InvokeMemberBinder binder, DynamicMetaObject[] args) {
                if (IsOverridden("TryInvokeMember")) {
                    return CallMethodWithResult("TryInvokeMember", binder, GetArgArray(args), (e) => binder.FallbackInvokeMember(this, args, e));
                } else if (IsOverridden("TryGetMember")) {
                    // Generate a tree like:
                    //
                    // {
                    //   object result;
                    //   TryGetMember(payload, out result) ? FallbackInvoke(result) : fallbackResult
                    // }
                    //
                    // Then it calls FallbackInvokeMember with this tree as the
                    // "error", giving the language the option of using this
                    // tree or doing .NET binding.
                    //
                    return CallMethodWithResult(
                        "TryGetMember", new GetBinderAdapter(binder), NoArgs,
                        (e) => binder.FallbackInvokeMember(this, args, e),
                        (e) => binder.FallbackInvoke(e, args, null)
                    );
                }

                return base.BindInvokeMember(binder, args);
            }
開發者ID:jxnmaomao,項目名稱:ironruby,代碼行數:24,代碼來源:DynamicObject.cs

示例8: BindInvokeMember

 public override DynamicMetaObject BindInvokeMember(InvokeMemberBinder binder, DynamicMetaObject[] args)
 {
     var expression = Expr.Dynamic(new LuaGetMemberBinder(binder.Name), typeof(object), Expression);
     return binder.FallbackInvoke(new DynamicMetaObject(expression, Restrictions), args, null);
 }
開發者ID:ericmj,項目名稱:IronLua,代碼行數:5,代碼來源:LuaTable.cs


注:本文中的System.Dynamic.InvokeMemberBinder.FallbackInvoke方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。