FallbackUnaryOperation() public method

Performs the binding of the unary dynamic operation if the target dynamic object cannot bind.
public FallbackUnaryOperation ( DynamicMetaObject target ) : DynamicMetaObject
target DynamicMetaObject The target of the dynamic unary operation.
return DynamicMetaObject
コード例 #1
0
            public override DynamicMetaObject BindUnaryOperation(UnaryOperationBinder binder)
            {
                Fallback fallback = null;

                if (!this.IsOverridden("TryUnaryOperation"))
                {
                    return(base.BindUnaryOperation(binder));
                }
                if (fallback == null)
                {
                    fallback = e => binder.FallbackUnaryOperation(this, e);
                }
                return(this.CallMethodWithResult("TryUnaryOperation", binder, NoArgs, fallback));
            }
コード例 #2
0
 /// <summary>
 /// Performs the binding of the dynamic unary operation.
 /// </summary>
 /// <param name="binder">An instance of the <see cref="UnaryOperationBinder"/> that represents the details of the dynamic operation.</param>
 /// <returns>The new <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
 public virtual DynamicMetaObject BindUnaryOperation(UnaryOperationBinder binder)
 {
     ContractUtils.RequiresNotNull(binder, "binder");
     return(binder.FallbackUnaryOperation(this));
 }
コード例 #3
0
            public override DynamicMetaObject BindUnaryOperation(UnaryOperationBinder binder) {
                if (IsOverridden("TryUnaryOperation")) {
                    return CallMethodWithResult("TryUnaryOperation", binder, NoArgs, (e) => binder.FallbackUnaryOperation(this, e));
                }

                return base.BindUnaryOperation(binder);
            }
コード例 #4
0
            public override DynamicMetaObject BindUnaryOperation(UnaryOperationBinder binder)
            {
                if (IsOverridden("TryUnaryOperation"))
                {
                    return(CallMethodWithResult("TryUnaryOperation", binder, s_noArgs, (e) => binder.FallbackUnaryOperation(this, e)));
                }

                return(base.BindUnaryOperation(binder));
            }
コード例 #5
0
 /// <summary>
 /// Performs the binding of the dynamic unary operation.
 /// </summary>
 /// <param name="binder">An instance of the <see cref="UnaryOperationBinder"/> that represents the details of the dynamic operation.</param>
 /// <returns>The new <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
 public virtual DynamicMetaObject BindUnaryOperation(UnaryOperationBinder binder) {
     ContractUtils.RequiresNotNull(binder, "binder");
     return binder.FallbackUnaryOperation(this);
 }
コード例 #6
0
ファイル: TotemType.cs プロジェクト: Alxandr/IronTotem
 public override DynamicMetaObject BindUnaryOperation(UnaryOperationBinder binder)
 {
     return binder.FallbackUnaryOperation(this);
 }
コード例 #7
0
 /// <summary>
 /// Performs the binding of the dynamic unary operation.
 /// </summary>
 /// <param name="binder">An instance of the <see cref="UnaryOperationBinder"/> that represents the details of the dynamic operation.</param>
 /// <returns>The new <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
 public virtual DynamicMetaObject BindUnaryOperation(UnaryOperationBinder binder)
 {
     ArgumentNullException.ThrowIfNull(binder);
     return(binder.FallbackUnaryOperation(this));
 }
コード例 #8
0
 public override DynamicMetaObject BindUnaryOperation(UnaryOperationBinder binder)
 {
     Fallback fallback = null;
     if (!this.IsOverridden("TryUnaryOperation"))
     {
         return base.BindUnaryOperation(binder);
     }
     if (fallback == null)
     {
         fallback = e => binder.FallbackUnaryOperation(this, e);
     }
     return this.CallMethodWithResult("TryUnaryOperation", binder, NoArgs, fallback);
 }
コード例 #9
0
 public override DynamicMetaObject BindUnaryOperation( UnaryOperationBinder binder )
 {
     return binder.FallbackUnaryOperation( _baseMetaObject,
                                           AddTypeRestrictions( _metaObject.BindUnaryOperation( binder ) ) );
 }