public void Reset()
 {
     if (m_currentSourceEnumerator != null)
     {
         m_currentSourceEnumerator.Dispose();
         m_currentSourceEnumerator = null;
     }
     m_currentSourceIndex = -1;
     m_current            = null;
 }
        public bool MoveNext()
        {
            // check for cancel
            if (m_current != null && m_process != null)
            {
                long  pointsReadInPreviousSources = m_sources.Take(m_currentSourceIndex).Sum(s => s.Count);
                float progress = (pointsReadInPreviousSources + m_current.Progress * m_sources[m_currentSourceIndex].Count) / m_points;

                if (!m_process.Update(progress))
                {
                    return(false);
                }
            }

            if (m_currentSourceEnumerator != null && m_currentSourceEnumerator.MoveNext())
            {
                m_current = m_currentSourceEnumerator.Current;
                return(true);
            }

            while (m_currentSourceIndex < m_sources.Length - 1)
            {
                if (m_currentSourceEnumerator != null)
                {
                    m_currentSourceEnumerator.Dispose();
                }

                m_currentSourceIndex++;
                m_currentSourceEnumerator = m_sources[m_currentSourceIndex].GetBlockEnumerator(m_buffer);

                if (m_currentSourceEnumerator.MoveNext())
                {
                    m_current = m_currentSourceEnumerator.Current;
                    return(true);
                }
            }

            return(false);
        }
        public bool MoveNext()
        {
            // check for cancel
            if (m_current != null && m_process != null)
            {
                long pointsReadInPreviousSources = m_sources.Take(m_currentSourceIndex).Sum(s => s.Count);
                float progress = (pointsReadInPreviousSources + m_current.Progress * m_sources[m_currentSourceIndex].Count) / m_points;

                if (!m_process.Update(progress))
                    return false;
            }

            if (m_currentSourceEnumerator != null && m_currentSourceEnumerator.MoveNext())
            {
                m_current = m_currentSourceEnumerator.Current;
                return true;
            }

            while (m_currentSourceIndex < m_sources.Length - 1)
            {
                if (m_currentSourceEnumerator != null)
                    m_currentSourceEnumerator.Dispose();

                m_currentSourceIndex++;
                m_currentSourceEnumerator = m_sources[m_currentSourceIndex].GetBlockEnumerator(m_buffer);

                if (m_currentSourceEnumerator.MoveNext())
                {
                    m_current = m_currentSourceEnumerator.Current;
                    return true;
                }
            }

            return false;
        }
 public void Reset()
 {
     if (m_currentSourceEnumerator != null)
     {
         m_currentSourceEnumerator.Dispose();
         m_currentSourceEnumerator = null;
     }
     m_currentSourceIndex = -1;
     m_current = null;
 }