Ejemplo n.º 1
0
 public bool MoveNext()
 {
     if (this.myEnumeratorValid)
     {
         if (this.myEnumerator.MoveNext())
         {
             return(true);
         }
         this.myEnumeratorValid = false;
     }
     if (this.myForward)
     {
         while ((this.myIndex + 1) < this.myArray.Count)
         {
             this.myIndex++;
             DiagramLayer layer1 = (DiagramLayer)this.myArray[this.myIndex];
             this.myEnumerator      = layer1.GetEnumerator();
             this.myEnumeratorValid = true;
             if (this.myEnumerator.MoveNext())
             {
                 return(true);
             }
         }
         return(false);
     }
     while ((this.myIndex - 1) >= 0)
     {
         this.myIndex--;
         DiagramLayer layer2 = (DiagramLayer)this.myArray[this.myIndex];
         this.myEnumerator      = layer2.Backwards;
         this.myEnumeratorValid = true;
         if (this.myEnumerator.MoveNext())
         {
             return(true);
         }
     }
     return(false);
 }