Ejemplo n.º 1
0
 // Token: 0x06008D85 RID: 36229 RVA: 0x002598B4 File Offset: 0x00257AB4
 bool IEnumerator.MoveNext()
 {
     if (this._group._version != this._version)
     {
         throw new InvalidOperationException();
     }
     while (this._subEnum == null || !this._subEnum.MoveNext())
     {
         this._index++;
         if (this._index >= this._group.Items.Count)
         {
             return(false);
         }
         CollectionViewGroupInternal collectionViewGroupInternal = this._group.Items[this._index] as CollectionViewGroupInternal;
         if (collectionViewGroupInternal == null)
         {
             this._current = this._group.Items[this._index];
             this._subEnum = null;
             return(true);
         }
         this._subEnum = collectionViewGroupInternal.GetLeafEnumerator();
     }
     this._current = this._subEnum.Current;
     return(true);
 }
            bool IEnumerator.MoveNext()
            {
                // check for invalidated enumerator
                if (_group._version != _version)
                {
                    throw new InvalidOperationException();
                }

                // move forward to the next leaf
                while (_subEnum == null || !_subEnum.MoveNext())
                {
                    // done with the current top-level item.  Move to the next one.
                    ++_index;
                    if (_index >= _group.Items.Count)
                    {
                        return(false);
                    }

                    CollectionViewGroupInternal subgroup = _group.Items[_index] as CollectionViewGroupInternal;
                    if (subgroup == null)
                    {
                        // current item is a leaf - it's the new Current
                        _current = _group.Items[_index];
                        _subEnum = null;
                        return(true);
                    }
                    else
                    {
                        // current item is a subgroup - get its enumerator
                        _subEnum = subgroup.GetLeafEnumerator();
                    }
                }

                // the loop terminates only when we have a subgroup enumerator
                // positioned at the new Current item
                _current = _subEnum.Current;
                return(true);
            }