예제 #1
0
 /// <summary>
 /// When overridden in a derived class provides the non-Meta implementation of deleting a member.
 ///
 /// When not overridden the call site requesting the binder determines the behavior.
 /// </summary>
 public virtual bool TryDeleteMember(DeleteMemberBinder binder)
 {
     throw new NotSupportedException();
 }
예제 #2
0
            public override MetaObject BindDeleteMember(DeleteMemberBinder binder) {
                ContractUtils.RequiresNotNull(binder, "binder");

                ExpandoClass klass;
                int index;

                ExpandoClass originalClass = GetClassEnsureIndex(binder.Name, binder.IgnoreCase, out klass, out index);

                string methodName = binder.IgnoreCase ? "ExpandoDeleteValueIgnoreCase" : "ExpandoDeleteValue";

                return new MetaObject(
                    AddDynamicTestAndDefer(
                        binder, 
                        new MetaObject[] { this }, 
                        klass, 
                        originalClass,
                        Expression.Convert(
                            Expression.Call(
                                typeof(RuntimeOps).GetMethod(methodName),
                                GetLimitedSelf(),
                                Expression.Constant(klass),
                                Expression.Constant(index)
                            ),
                            typeof(object)
                        )
                    ),
                    GetRestrictions()
                );
            }
예제 #3
0
 public virtual MetaObject BindDeleteMember(DeleteMemberBinder binder)
 {
     ContractUtils.RequiresNotNull(binder, "binder");
     return(binder.FallbackDeleteMember(this));
 }
예제 #4
0
 /// <summary>
 /// When overridden in a derived class provides the non-Meta implementation of deleting a member.
 /// 
 /// When not overridden the call site requesting the binder determines the behavior.
 /// </summary>
 public virtual bool TryDeleteMember(DeleteMemberBinder binder) {
     throw new NotSupportedException();
 }
예제 #5
0
            public override MetaObject BindDeleteMember(DeleteMemberBinder binder) {
                if (IsOverridden("TryDeleteMember")) {
                    return CallMethodNoResult("TryDeleteMember", binder, NoArgs, (e) => binder.FallbackDeleteMember(this, e));
                }

                return base.BindDeleteMember(binder);
            }
예제 #6
0
        public override bool Equals(object obj)
        {
            DeleteMemberBinder dma = obj as DeleteMemberBinder;

            return(dma != null && dma._name == _name && dma._ignoreCase == _ignoreCase);
        }
예제 #7
0
 public virtual MetaObject BindDeleteMember(DeleteMemberBinder binder) {
     ContractUtils.RequiresNotNull(binder, "binder");
     return binder.FallbackDeleteMember(this);
 }