本文整理汇总了C#中System.Dynamic.InvokeMemberBinder.Defer方法的典型用法代码示例。如果您正苦于以下问题:C# InvokeMemberBinder.Defer方法的具体用法?C# InvokeMemberBinder.Defer怎么用?C# InvokeMemberBinder.Defer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Dynamic.InvokeMemberBinder
的用法示例。
在下文中一共展示了InvokeMemberBinder.Defer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BindInvokeMember
public override DynamicMetaObject BindInvokeMember(InvokeMemberBinder binder, DynamicMetaObject[] args) {
ContractUtils.RequiresNotNull(binder, "binder");
return binder.Defer(args.AddFirst(WrapSelf()));
}
示例2: 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
);
}
示例3: BindInvokeMember
public override DynamicMetaObject BindInvokeMember(InvokeMemberBinder binder, DynamicMetaObject[] args)
{
return binder.Defer(args.AddFirst(WrapSelf()));
}