Example #1
0
 // Token: 0x060073A0 RID: 29600 RVA: 0x002115DC File Offset: 0x0020F7DC
 internal void Clear()
 {
     this.FullCount          = 1;
     base.ProtectedItemCount = 0;
     if (this._groupBy != null)
     {
         PropertyChangedEventManager.RemoveHandler(this._groupBy, new EventHandler <PropertyChangedEventArgs>(this.OnGroupByChanged), string.Empty);
         this._groupBy = null;
         int i     = 0;
         int count = base.ProtectedItems.Count;
         while (i < count)
         {
             CollectionViewGroupInternal collectionViewGroupInternal = base.ProtectedItems[i] as CollectionViewGroupInternal;
             if (collectionViewGroupInternal != null)
             {
                 collectionViewGroupInternal.Clear();
             }
             i++;
         }
     }
     base.ProtectedItems.Clear();
     if (this._nameToGroupMap != null)
     {
         this._nameToGroupMap.Clear();
     }
 }
Example #2
0
        // Token: 0x0600739F RID: 29599 RVA: 0x00211574 File Offset: 0x0020F774
        internal int Remove(object item, bool returnLeafIndex)
        {
            int result = -1;
            int num    = base.ProtectedItems.IndexOf(item);

            if (num >= 0)
            {
                if (returnLeafIndex)
                {
                    result = this.LeafIndexFromItem(null, num);
                }
                CollectionViewGroupInternal collectionViewGroupInternal = item as CollectionViewGroupInternal;
                if (collectionViewGroupInternal != null)
                {
                    collectionViewGroupInternal.Clear();
                    this.RemoveSubgroupFromMap(collectionViewGroupInternal);
                }
                this.ChangeCounts(item, -1);
                if (base.ProtectedItems.Count > 0)
                {
                    base.ProtectedItems.RemoveAt(num);
                }
            }
            return(result);
        }
        internal int Remove(object item, bool returnLeafIndex)
        {
            int index      = -1;
            int localIndex = ProtectedItems.IndexOf(item);

            if (localIndex >= 0)
            {
                if (returnLeafIndex)
                {
                    index = LeafIndexFromItem(null, localIndex);
                }

                CollectionViewGroupInternal subGroup = item as CollectionViewGroupInternal;
                if (subGroup != null)
                {
                    subGroup.Clear();

                    // Remove from the name to group map.
                    RemoveSubgroupFromMap(subGroup);
                }

                ChangeCounts(item, -1);

                // ChangeCounts may clear this group, if it is now empty.
                // In that case, don't use localIndex - it's now out of range.
                if (ProtectedItems.Count > 0)
                {
                    ProtectedItems.RemoveAt(localIndex);
                }
            }

            return(index);
        }
        internal void Clear()
        {
            // reset the counts before delving into subgroups.   The subgroup
            // changes can incur re-entrant calls to LeafAt(index) which will
            // get out-of-range exceptions (DDVSO 656948), unless we fend them
            // off by ensuring that count<=index.
            FullCount          = 1;
            ProtectedItemCount = 0;

            if (_groupBy != null)
            {
                // This group has subgroups.  Disconnect from GroupDescription events
                PropertyChangedEventManager.RemoveHandler(_groupBy, OnGroupByChanged, String.Empty);
                _groupBy = null;

                // recursively clear subgroups
                for (int i = 0, n = ProtectedItems.Count; i < n; ++i)
                {
                    CollectionViewGroupInternal subGroup = ProtectedItems[i] as CollectionViewGroupInternal;
                    if (subGroup != null)
                    {
                        subGroup.Clear();
                    }
                }
            }

            ProtectedItems.Clear();
            if (_nameToGroupMap != null)
            {
                _nameToGroupMap.Clear();
            }
        }
Example #5
0
        internal void Clear()
        {
            if (_groupBy != null)
            {
                // This group has subgroups.  Disconnect from GroupDescription events
                PropertyChangedEventManager.RemoveHandler(_groupBy, OnGroupByChanged, String.Empty);
                _groupBy = null;

                // recursively clear subgroups
                for (int i = 0, n = ProtectedItems.Count; i < n; ++i)
                {
                    CollectionViewGroupInternal subGroup = ProtectedItems[i] as CollectionViewGroupInternal;
                    if (subGroup != null)
                    {
                        subGroup.Clear();
                    }
                }
            }

            FullCount          = 1;
            ProtectedItemCount = 0;
            ProtectedItems.Clear();
            if (_nameToGroupMap != null)
            {
                _nameToGroupMap.Clear();
            }
        }