PageRenderTime 273ms CodeModel.GetById 120ms app.highlight 2ms RepoModel.GetById 149ms app.codeStats 0ms

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