Beispiel #1
0
        public virtual Boolean MoveNext()
        {
            Boolean result;

            if (!Completed)
            {
                if (ProgressQueue.Count > 0)
                {
                    TreeNodeType node = ProgressQueue.Dequeue();

                    foreach (TreeNodeType child in node.Children)
                    {
                        ProgressQueue.Enqueue(child);
                    }

                    CurrentItem = node;
                }
                else // Enumeration is complete.
                {
                    CurrentItem = InvalidItem;
                    Completed   = true;
                }

                result = !CurrentItem.Equals(InvalidItem);
            }
            else
            {
                result = false;
            }

            return(result);
        }
Beispiel #2
0
        public virtual void Reset()
        {
            CurrentItem = InvalidItem;
            Completed   = false;

            ProgressQueue.Clear();
            ProgressQueue.Enqueue(Root);
        }
Beispiel #3
0
        public void WriteProgress(long sourceId, ProgressRecordEx progressRecord)
        {
            ProgressQueue.Enqueue(progressRecord);

            WriteProtectedProgress(() => realWriter.WriteProgress(sourceId, progressRecord));
        }
Beispiel #4
0
        public void WriteProgress(ProgressRecordEx progressRecord)
        {
            ProgressQueue.Enqueue(progressRecord);

            WriteProtectedProgress(() => realWriter.WriteProgress(progressRecord));
        }