public FallbackDeleteMember ( |
||
target | The target of the dynamic delete member operation. | |
리턴 |
public override DynamicMetaObject BindDeleteMember(DeleteMemberBinder binder) { if (IsOverridden("TryDeleteMember")) { return(CallMethodNoResult("TryDeleteMember", binder, NoArgs, (e) => binder.FallbackDeleteMember(this, e))); } return(base.BindDeleteMember(binder)); }
public override DynamicMetaObject BindDeleteMember(DeleteMemberBinder binder) { Fallback fallback = null; if (!this.IsOverridden("TryDeleteMember")) { return(base.BindDeleteMember(binder)); } if (fallback == null) { fallback = e => binder.FallbackDeleteMember(this, e); } return(this.CallMethodNoResult("TryDeleteMember", binder, NoArgs, fallback)); }
public override DynamicMetaObject BindDeleteMember(DeleteMemberBinder binder) { ContractUtils.RequiresNotNull(binder, nameof(binder)); int index = Value.Class.GetValueIndex(binder.Name, binder.IgnoreCase, Value); Expression tryDelete = Expression.Call( typeof(RuntimeOps).GetMethod("ExpandoTryDeleteValue"), GetLimitedSelf(), Expression.Constant(Value.Class, typeof(object)), Expression.Constant(index), Expression.Constant(binder.Name), Expression.Constant(binder.IgnoreCase) ); DynamicMetaObject fallback = binder.FallbackDeleteMember(this); DynamicMetaObject target = new DynamicMetaObject( Expression.IfThen(Expression.Not(tryDelete), fallback.Expression), fallback.Restrictions ); return(AddDynamicTestAndDefer(binder, Value.Class, null, target)); }
public override DynamicMetaObject BindDeleteMember(DeleteMemberBinder binder) { ArgumentNullException.ThrowIfNull(binder); int index = Value.Class.GetValueIndex(binder.Name, binder.IgnoreCase, Value); Expression tryDelete = Expression.Call( s_expandoTryDeleteValue, GetLimitedSelf(), Expression.Constant(Value.Class, typeof(object)), AstUtils.Constant(index), Expression.Constant(binder.Name), AstUtils.Constant(binder.IgnoreCase) ); DynamicMetaObject fallback = binder.FallbackDeleteMember(this); DynamicMetaObject target = new DynamicMetaObject( Expression.IfThen(Expression.Not(tryDelete), fallback.Expression), fallback.Restrictions ); return(AddDynamicTestAndDefer(binder, Value.Class, null, target)); }
/// <summary> /// Performs the binding of the dynamic delete member operation. /// </summary> /// <param name="binder">An instance of the <see cref="DeleteMemberBinder"/> 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 BindDeleteMember(DeleteMemberBinder binder) { ContractUtils.RequiresNotNull(binder, "binder"); return(binder.FallbackDeleteMember(this)); }
public override DynamicMetaObject BindDeleteMember(DeleteMemberBinder binder) { if (IsOverridden("TryDeleteMember")) { return CallMethodNoResult("TryDeleteMember", binder, NoArgs, (e) => binder.FallbackDeleteMember(this, e)); } return base.BindDeleteMember(binder); }
/// <summary> /// Performs the binding of the dynamic delete member operation. /// </summary> /// <param name="binder">An instance of the <see cref="DeleteMemberBinder"/> 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 BindDeleteMember(DeleteMemberBinder binder) { ContractUtils.RequiresNotNull(binder, "binder"); return binder.FallbackDeleteMember(this); }
public override DynamicMetaObject BindDeleteMember(DeleteMemberBinder binder) { ContractUtils.RequiresNotNull(binder, "binder"); string methodName = binder.IgnoreCase ? "ExpandoTryDeleteValueIgnoreCase" : "ExpandoTryDeleteValue"; int index = Value.Class.GetValueIndex(binder.Name, binder.IgnoreCase, Value); Expression tryDelete = Expression.Call( typeof(RuntimeOps).GetMethod(methodName), GetLimitedSelf(), Expression.Constant(Value.Class), Expression.Constant(index) ); DynamicMetaObject fallback = binder.FallbackDeleteMember(this); DynamicMetaObject target = new DynamicMetaObject( Expression.Condition( Expression.IsFalse(tryDelete), Helpers.Convert(fallback.Expression, typeof(object)), //if fail to delete, fall back Helpers.Convert(Expression.Constant(true), typeof(object)) ), fallback.Restrictions ); return AddDynamicTestAndDefer( binder, new DynamicMetaObject[] { this }, Value.Class, null, target ); }
/// <summary> /// Performs the binding of the dynamic delete member operation. /// </summary> /// <param name="binder">An instance of the <see cref="DeleteMemberBinder"/> 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 BindDeleteMember(DeleteMemberBinder binder) { ArgumentNullException.ThrowIfNull(binder); return(binder.FallbackDeleteMember(this)); }
public override DynamicMetaObject BindDeleteMember(DeleteMemberBinder binder) { return new DynamicMetaObject( Expression.Condition( Expression.Invoke( Expression.Constant(_deleteMember), Expression, Expression.Constant(binder.Name) ), Expression.Default(binder.ReturnType), binder.FallbackDeleteMember(this).Expression ), GetRestrictions() ); }
public override DynamicMetaObject BindDeleteMember(DeleteMemberBinder binder) { Fallback fallback = null; if (!this.IsOverridden("TryDeleteMember")) { return base.BindDeleteMember(binder); } if (fallback == null) { fallback = e => binder.FallbackDeleteMember(this, e); } return this.CallMethodNoResult("TryDeleteMember", binder, NoArgs, fallback); }
public override DynamicMetaObject BindDeleteMember(DeleteMemberBinder binder) { return new DynamicMetaObject( Expression.Condition( Expression.Invoke( Expression.Constant(new Func<object, SymbolId, bool>(AttributesAdapter.TryDeleteMember)), Expression, Expression.Constant(SymbolTable.StringToId(binder.Name)) ), Expression.Default(binder.ReturnType), binder.FallbackDeleteMember(this).Expression ), GetRestrictions() ); }
public override DynamicMetaObject BindDeleteMember( DeleteMemberBinder binder ) { return binder.FallbackDeleteMember( _baseMetaObject, AddTypeRestrictions( _metaObject.BindDeleteMember( binder ) ) ); }