Exemplo n.º 1
0
 public bool MoveNext()
 {
     EnumeratorHelper.CheckVersion(this.ver, this.pq.version);
     EnumeratorHelper.EnumeratorState state = this.state;
     if (state == EnumeratorHelper.EnumeratorState.Before)
     {
         if (this.pq.Count == 0)
         {
             this.state = EnumeratorHelper.EnumeratorState.After;
             return(false);
         }
         this.state = EnumeratorHelper.EnumeratorState.Current;
         this.index = 1;
         return(true);
     }
     if (state != EnumeratorHelper.EnumeratorState.After)
     {
         if (++this.index <= this.pq.Count)
         {
             return(true);
         }
         this.state = EnumeratorHelper.EnumeratorState.After;
     }
     return(false);
 }
Exemplo n.º 2
0
 void IEnumerator.Reset()
 {
     EnumeratorHelper.CheckVersion(this.ver, this.pq.version);
     this.state = EnumeratorHelper.EnumeratorState.Before;
 }