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
Exemplo n.º 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));
            }
Exemplo n.º 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));
 }
Exemplo n.º 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);
            }
Exemplo n.º 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));
            }
Exemplo n.º 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);
 }
Exemplo n.º 6
0
 public override DynamicMetaObject BindUnaryOperation(UnaryOperationBinder binder)
 {
     return binder.FallbackUnaryOperation(this);
 }
Exemplo n.º 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));
 }
 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);
 }
Exemplo n.º 9
0
 public override DynamicMetaObject BindUnaryOperation( UnaryOperationBinder binder )
 {
     return binder.FallbackUnaryOperation( _baseMetaObject,
                                           AddTypeRestrictions( _metaObject.BindUnaryOperation( binder ) ) );
 }