Example #1
0
 public void Reset()
 {
     this.position = CollectionView.PlaceholderAwareEnumerator.Position.BeforeNewItem;
     this.baseEnumerator.Reset();
 }
Example #2
0
 public bool MoveNext()
 {
     if (this.timestamp != this.collectionView.Timestamp)
     {
         throw new InvalidOperationException("CollectionView_EnumeratorVersionChanged");
     }
     if (this.position == CollectionView.PlaceholderAwareEnumerator.Position.BeforeNewItem)
     {
         if (!this.baseEnumerator.MoveNext() || (this.newItem != CollectionView.NoNewItem && this.baseEnumerator.Current == this.newItem && !this.baseEnumerator.MoveNext()))
         {
             if (this.newItem == CollectionView.NoNewItem)
             {
                 return false;
             }
             this.position = CollectionView.PlaceholderAwareEnumerator.Position.OnNewItem;
         }
         return true;
     }
     else
     {
         this.position = CollectionView.PlaceholderAwareEnumerator.Position.AfterNewItem;
         if (!this.baseEnumerator.MoveNext())
         {
             return false;
         }
         if (this.newItem != CollectionView.NoNewItem && this.baseEnumerator.Current == this.newItem)
         {
             return this.baseEnumerator.MoveNext();
         }
         return true;
     }
 }