Ejemplo n.º 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);
        }
Ejemplo n.º 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;
        }