Example #1
0
        /// <summary>
        /// Returns an System.Collection.IEnumerator that can iterate
        /// through the RedBlackTree.
        /// </summary>
        public IEnumerator GetEnumerator()
        {
            RedBlackTreeEnumerator tEnum;

            rwLock.AcquireReaderLock(Timeout.Infinite);

            try
            {
                tEnum = new RedBlackTreeEnumerator(this);
                RedBlackTreeModified += new RedBlackTreeModifiedHandler(tEnum.Invalidate);
            }
            finally
            {
                rwLock.ReleaseReaderLock();
            }

            return(tEnum);
        }
Example #2
0
        /// <summary>
        /// Returns an System.Collection.IEnumerator that can iterate
        /// through the RedBlackTree.
        /// </summary>
        public IEnumerator GetEnumerator()
        {
            RedBlackTreeEnumerator tEnum;

            rwLock.AcquireReaderLock(Timeout.Infinite);

            try 
            {
                tEnum = new RedBlackTreeEnumerator(this);
                RedBlackTreeModified += new RedBlackTreeModifiedHandler(tEnum.Invalidate);
            }
            finally
            {
                rwLock.ReleaseReaderLock();
            }

            return tEnum;
        }