public FallbackBinaryOperation ( |
||
target | The target of the dynamic binary operation. | |
arg | The right hand side operand of the dynamic binary operation. | |
return |
public override DynamicMetaObject BindBinaryOperation(BinaryOperationBinder binder, DynamicMetaObject arg) { Fallback fallback = null; if (!this.IsOverridden("TryBinaryOperation")) { return(base.BindBinaryOperation(binder, arg)); } if (fallback == null) { fallback = e => binder.FallbackBinaryOperation(this, arg, e); } return(this.CallMethodWithResult("TryBinaryOperation", binder, GetArgs(new DynamicMetaObject[] { arg }), fallback)); }
/// <summary> /// Performs the binding of the dynamic binary operation. /// </summary> /// <param name="binder">An instance of the <see cref="BinaryOperationBinder"/> that represents the details of the dynamic operation.</param> /// <param name="arg">An instance of the <see cref="DynamicMetaObject"/> representing the right hand side of the binary operation.</param> /// <returns>The new <see cref="DynamicMetaObject"/> representing the result of the binding.</returns> public virtual DynamicMetaObject BindBinaryOperation(BinaryOperationBinder binder, DynamicMetaObject arg) { ContractUtils.RequiresNotNull(binder, "binder"); return(binder.FallbackBinaryOperation(this, arg)); }
public override DynamicMetaObject BindBinaryOperation(BinaryOperationBinder binder, DynamicMetaObject arg) { if (IsOverridden("TryBinaryOperation")) { return CallMethodWithResult("TryBinaryOperation", binder, DynamicMetaObject.GetExpressions(new DynamicMetaObject[] {arg}), (e) => binder.FallbackBinaryOperation(this, arg, e)); } return base.BindBinaryOperation(binder, arg); }
public override DynamicMetaObject BindBinaryOperation(BinaryOperationBinder binder, DynamicMetaObject arg) { if (IsOverridden("TryBinaryOperation")) { return(CallMethodWithResult("TryBinaryOperation", binder, DynamicMetaObject.GetExpressions(new DynamicMetaObject[] { arg }), (e) => binder.FallbackBinaryOperation(this, arg, e))); } return(base.BindBinaryOperation(binder, arg)); }
/// <summary> /// Performs the binding of the dynamic binary operation. /// </summary> /// <param name="binder">An instance of the <see cref="BinaryOperationBinder"/> that represents the details of the dynamic operation.</param> /// <param name="arg">An instance of the <see cref="DynamicMetaObject"/> representing the right hand side of the binary operation.</param> /// <returns>The new <see cref="DynamicMetaObject"/> representing the result of the binding.</returns> public virtual DynamicMetaObject BindBinaryOperation(BinaryOperationBinder binder, DynamicMetaObject arg) { ContractUtils.RequiresNotNull(binder, "binder"); return binder.FallbackBinaryOperation(this, arg); }
public override DynamicMetaObject BindBinaryOperation(BinaryOperationBinder binder, DynamicMetaObject arg) { DynamicMetaObject result = null; if (!(arg is TotemType.MetaObject)) { var lt = arg.LimitType; var handler = _type._context.GetTypeHandler(lt); if (handler != null) handler.GetBinaryOperator(binder.Operation); } var op = _type.GetBinaryOperator(binder.Operation); if (op != null) { if (TotemProtocol.TryResolveOverload(binder, _type, new CallInfo(2), TotemProtocol.GetOperationName(binder.Operation), op, null, new[] { this, arg }, out result)) return result; } return binder.FallbackBinaryOperation(this, arg, result); }
/// <summary> /// Performs the binding of the dynamic binary operation. /// </summary> /// <param name="binder">An instance of the <see cref="BinaryOperationBinder"/> that represents the details of the dynamic operation.</param> /// <param name="arg">An instance of the <see cref="DynamicMetaObject"/> representing the right hand side of the binary operation.</param> /// <returns>The new <see cref="DynamicMetaObject"/> representing the result of the binding.</returns> public virtual DynamicMetaObject BindBinaryOperation(BinaryOperationBinder binder, DynamicMetaObject arg) { ArgumentNullException.ThrowIfNull(binder); return(binder.FallbackBinaryOperation(this, arg)); }
public override DynamicMetaObject BindBinaryOperation(BinaryOperationBinder binder, DynamicMetaObject arg) { Fallback fallback = null; if (!this.IsOverridden("TryBinaryOperation")) { return base.BindBinaryOperation(binder, arg); } if (fallback == null) { fallback = e => binder.FallbackBinaryOperation(this, arg, e); } return this.CallMethodWithResult("TryBinaryOperation", binder, GetArgs(new DynamicMetaObject[] { arg }), fallback); }
/// <summary> /// Performs the binding of the dynamic binary operation. /// </summary> /// <param name="binder"> /// An instance of the <see cref="T:System.Dynamic.BinaryOperationBinder" /> that represents the details of the dynamic operation. /// </param> /// <param name="arg"> /// An instance of the <see cref="T:System.Dynamic.DynamicMetaObject" /> representing the right hand side of the binary operation. /// </param> /// <returns> /// The new <see cref="T:System.Dynamic.DynamicMetaObject" /> representing the result of the binding. /// </returns> public override DynamicMetaObject BindBinaryOperation( BinaryOperationBinder binder, DynamicMetaObject arg ) { return ApplyBinding( meta => meta.BindBinaryOperation( binder, arg ), ( target, errorSuggestion ) => binder.FallbackBinaryOperation( target, arg, errorSuggestion ) ); }
public override DynamicMetaObject BindBinaryOperation( BinaryOperationBinder binder, DynamicMetaObject arg ) { return binder.FallbackBinaryOperation( _baseMetaObject, arg, AddTypeRestrictions( _metaObject.BindBinaryOperation( binder, arg ) ) ); }