/Rhino.Etl.Core/Enumerables/EventRaisingEnumerator.cs

http://github.com/ayende/rhino-etl · C# · 38 lines · 17 code · 4 blank · 17 comment · 1 complexity · 25da6afd4c58bf5d92e29ab7555d6250 MD5 · raw file

  1. namespace Rhino.Etl.Core.Enumerables
  2. {
  3. using System.Collections.Generic;
  4. using Operations;
  5. /// <summary>
  6. /// An enumerator that will raise the events on the operation for each iterated item
  7. /// </summary>
  8. public class EventRaisingEnumerator : SingleRowEventRaisingEnumerator
  9. {
  10. /// <summary>
  11. /// Initializes a new instance of the <see cref="EventRaisingEnumerator"/> class.
  12. /// </summary>
  13. /// <param name="operation">The operation.</param>
  14. /// <param name="inner">The innerEnumerator.</param>
  15. public EventRaisingEnumerator(IOperation operation, IEnumerable<Row> inner) : base(operation, inner)
  16. {}
  17. ///<summary>
  18. ///Advances the enumerator to the next element of the collection.
  19. ///</summary>
  20. ///
  21. ///<returns>
  22. ///true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.
  23. ///</returns>
  24. ///
  25. ///<exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>
  26. public override bool MoveNext()
  27. {
  28. bool result = base.MoveNext();
  29. if(!result)
  30. operation.RaiseFinishedProcessing();
  31. return result;
  32. }
  33. }
  34. }