Esempio n. 1
0
 /// <summary>
 /// Makes the events.
 /// </summary>
 /// <param name="maxNumEvents">The max num events.</param>
 /// <param name="callback">The callback.</param>
 /// <returns></returns>
 public static IEnumerator <object> MakeEvents(int maxNumEvents, GeneratorIteratorCallback callback)
 {
     for (int ii = 0; ii < maxNumEvents; ii++)
     {
         yield return(callback.Invoke(ii));
     }
 }
Esempio n. 2
0
 public bool MoveNext()
 {
     if (_numEvents < _maxNumEvents)
     {
         _current = _callback.Invoke(_numEvents);
         _numEvents++;
         return(true);
     }
     return(false);
 }