Example #1
0
 private bool SetNextBoxEnumerator()
 {
     if (_box.BoxCollection.Count == indexOfBoxes)
     {
         indexOfBoxes = 0;
         return(false);
     }
     else
     {
         _CurrentBox            = _box.BoxCollection[indexOfBoxes];
         _currentItemEnumerator = new ItemEnumerator(_box.BoxCollection[indexOfBoxes].ItemCollection);
         indexOfBoxes          += 1;
         return(MoveNext());
     }
 }
Example #2
0
        public bool MoveNext()
        {
            if (indexOfBoxes == 0 && indexOfItems == 0)
            {
                _currentItemEnumerator = new ItemEnumerator(_box.ItemCollection);
            }

            if (_currentItemEnumerator.MoveNext())
            {
                _CurrentItem  = _currentItemEnumerator.Current;
                indexOfItems += 1;
                return(true);
            }
            else
            {
                return(SetNextBoxEnumerator());
            }
        }