/// <summary> /// Performs the binding of the dynamic unary operation. /// </summary> /// <param name="target">The target of the dynamic operation.</param> /// <param name="args">An array of arguments of the dynamic operation.</param> /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns> public sealed override DynamicMetaObject Bind(DynamicMetaObject target, DynamicMetaObject[] args) { ContractUtils.RequiresNotNull(target, "target"); ContractUtils.Requires(args == null || args.Length == 0, "args"); return(target.BindUnaryOperation(this)); }
public static void TestMetaObject(DynamicMetaObject target, ExpressionType[] testExpressions, bool isValid = true) { foreach (ExpressionType expType in testExpressions) { UnaryOperationBinder binder = new TestUnaryOperationBinder(expType); DynamicMetaObject result = target.BindUnaryOperation(binder); Assert.IsNotNull(result); UnaryExpression expression = result.Expression as UnaryExpression; Assert.IsNotNull(expression); ExpressionType expectedType = isValid ? expType : ExpressionType.Throw; Assert.AreEqual <ExpressionType>(expectedType, expression.Operand.NodeType); } }
public override DynamicMetaObject BindUnaryOperation(UnaryOperationBinder binder) { return(AddRestrictions(_metaForwardee.BindUnaryOperation(binder))); }
public override DynamicMetaObject BindUnaryOperation(UnaryOperationBinder binder) { return(scriptItem.PostProcessBindResult(metaDynamic.BindUnaryOperation(binder))); }
public override DynamicMetaObject BindUnaryOperation(UnaryOperationBinder binder) => _innerMetaObject.BindUnaryOperation(binder);
public override DynamicMetaObject BindUnaryOperation(UnaryOperationBinder binder) { return(_innerMetaObject.BindUnaryOperation(binder)); }
/// <summary> /// Performs the binding of the dynamic unary operation. /// </summary> /// <param name="target">The target of the dynamic operation.</param> /// <param name="args">An array of arguments of the dynamic operation.</param> /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns> public sealed override DynamicMetaObject Bind(DynamicMetaObject target, DynamicMetaObject[] args) { ContractUtils.RequiresNotNull(target, "target"); ContractUtils.Requires(args == null || args.Length == 0, "args"); return target.BindUnaryOperation(this); }
public static void TestBindParams(DynamicMetaObject target) { UnaryOperationBinder binder = new TestUnaryOperationBinder(ExpressionType.Negate); ExceptionTestHelper.ExpectException <ArgumentNullException>(() => { var result = target.BindUnaryOperation(null); }); }
public override DynamicMetaObject BindUnaryOperation(UnaryOperationBinder binder) { return(binder.FallbackUnaryOperation(_baseMetaObject, AddTypeRestrictions(_metaObject.BindUnaryOperation(binder)))); }