void IList.Remove(object value)
        {
#if (TRACE)
            Console.WriteLine("void IList.Remove(object value)");
#endif
            tgEntity entity = value as tgEntity;

            entities.Remove((T)entity);

            if (entity.RowState != tgDataRowState.Deleted && entity.RowState != tgDataRowState.Added)
            {
                entity.MarkAsDeleted();
            }

            if (entitiesFilterBackup != null)
            {
                IList i = entitiesFilterBackup as IList;
                i.Remove(entity);
            }

            if (updateViewNotification != null)
            {
                OnUpdateViewNotification(this, ListChangedType.ItemDeleted, entity);
            }
        }
示例#2
0
        void IList.RemoveAt(int index)
        {
#if (TRACE)
            Console.WriteLine("void IList.RemoveAt(int index)");
#endif
            tgEntity entity = ((IList)entities)[index] as tgEntity;

            entities.Remove((T)entity);

            entity.MarkAsDeleted();

            if (entitiesFilterBackup != null)
            {
                IList i = entitiesFilterBackup as IList;
                i.Remove(entity);
            }
        }
示例#3
0
        void IList.Remove(object value)
        {
#if (TRACE)
            Console.WriteLine("void IList.Remove(object value)");
#endif
            tgEntity entity = value as tgEntity;

            entities.Remove((T)entity);

            entity.MarkAsDeleted();

            if (entitiesFilterBackup != null)
            {
                IList i = entitiesFilterBackup as IList;
                i.Remove(entity);
            }
        }
示例#4
0
        bool ICollection <T> .Remove(T item)
        {
#if (TRACE)
            Console.WriteLine("bool ICollection<T>.Remove(T item)");
#endif
            tgEntity entity = item as tgEntity;

            IList list    = this as IList;
            bool  removed = list.Contains(item);

            entities.Remove((T)entity);

            entity.MarkAsDeleted();

            if (entitiesFilterBackup != null)
            {
                IList i = entitiesFilterBackup as IList;
                i.Remove(entity);
            }

            return(removed);
        }
        void IList.RemoveAt(int index)
        {
#if (TRACE)
            Console.WriteLine("void IList.RemoveAt(int index)");
#endif
            tgEntity entity = ((IList)entities)[index] as tgEntity;

            entities.Remove((T)entity);

            entity.MarkAsDeleted();

            if (entitiesFilterBackup != null)
            {
                IList i = entitiesFilterBackup as IList;
                i.Remove(entity);
            }

            if (updateViewNotification != null)
            {
                OnUpdateViewNotification(this, ListChangedType.ItemDeleted, entity);
            }
        }
        bool ICollection <T> .Remove(T item)
        {
#if (TRACE)
            Console.WriteLine("bool ICollection<T>.Remove(T item)");
#endif
            tgEntity entity = item as tgEntity;

            bool removed = entities.Remove((T)entity);

            entity.MarkAsDeleted();

            if (entitiesFilterBackup != null)
            {
                IList i = entitiesFilterBackup as IList;
                i.Remove(entity);
            }

            if (updateViewNotification != null)
            {
                OnUpdateViewNotification(this, ListChangedType.ItemDeleted, entity);
            }

            return(removed);
        }