/// <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); }
/// <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; }