public const string UnterminatedBracket = "UnterminatedBracket";
public const string UnterminatedComment = "UnterminatedComment";
+ public const string Arg_ArrayPlusOffTooSmall = "Arg_ArrayPlusOffTooSmall";
+ public const string Arg_InsufficientSpace = "Arg_InsufficientSpace";
+ public const string Arg_MultiRank = "Arg_MultiRank";
+ public const string Arg_NonZeroLowerBound = "Arg_NonZeroLowerBound";
+ public const string Arg_WrongType = "Arg_WrongType";
+ public const string ArgumentOutOfRange_Index = "ArgumentOutOfRange_Index";
+ public const string ArgumentOutOfRange_NeedNonNegNum = "ArgumentOutOfRange_NeedNonNegNum";
+ public const string ArgumentOutOfRange_NeedNonNegNumRequired = "ArgumentOutOfRange_NeedNonNegNumRequired";
+ public const string ArgumentOutOfRange_SmallCapacity = "ArgumentOutOfRange_SmallCapacity";
+ public const string Argument_AddingDuplicate = "Argument_AddingDuplicate";
+ public const string Argument_ImplementIComparable = "Argument_ImplementIComparable";
+ public const string Argument_InvalidOffLen = "Argument_InvalidOffLen";
+ public const string ExternalLinkedListNode = "ExternalLinkedListNode";
+ public const string IndexOutOfRange = "IndexOutOfRange";
+ public const string InvalidOperation_CannotRemoveFromStackOrQueue = "InvalidOperation_CannotRemoveFromStackOrQueue";
+ public const string InvalidOperation_EmptyCollection = "InvalidOperation_EmptyCollection";
+ public const string InvalidOperation_EmptyQueue = "InvalidOperation_EmptyQueue";
+ public const string InvalidOperation_EmptyStack = "InvalidOperation_EmptyStack";
+ public const string InvalidOperation_EnumEnded = "InvalidOperation_EnumEnded";
+ public const string InvalidOperation_EnumFailedVersion = "InvalidOperation_EnumFailedVersion";
+ public const string InvalidOperation_EnumNotStarted = "InvalidOperation_EnumNotStarted";
+ public const string InvalidOperation_EnumOpCantHappen = "InvalidOperation_EnumOpCantHappen";
+ public const string Invalid_Array_Type = "Invalid_Array_Type";
+ public const string LinkedListEmpty = "LinkedListEmpty";
+ public const string LinkedListNodeIsAttached = "LinkedListNodeIsAttached";
+ public const string NotSupported_KeyCollectionSet = "NotSupported_KeyCollectionSet";
+ public const string NotSupported_SortedListNestedWrite = "NotSupported_SortedListNestedWrite";
+ public const string NotSupported_ValueCollectionSet = "NotSupported_ValueCollectionSet";
+ public const string Serialization_InvalidOnDeser = "Serialization_InvalidOnDeser";
+ public const string Serialization_MismatchedCount = "Serialization_MismatchedCount";
+ public const string Serialization_MissingValues = "Serialization_MissingValues";
+
public const string BlockingCollection_Add_ConcurrentCompleteAdd = "BlockingCollection_Add_ConcurrentCompleteAdd";
public const string BlockingCollection_Add_Failed = "BlockingCollection_Add_Failed";
public const string BlockingCollection_CantAddAnyWhenCompleted = "BlockingCollection_CantAddAnyWhenCompleted";
+++ /dev/null
-//
-// BlockingCollection.cs
-//
-// Copyright (c) 2008 Jérémie "Garuma" Laval
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-#if NET_4_0
-
-using System;
-using System.Threading;
-using System.Collections;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-
-namespace System.Collections.Concurrent
-{
- [ComVisible (false)]
- [DebuggerDisplay ("Count={Count}")]
- [DebuggerTypeProxy (typeof (CollectionDebuggerView<>))]
- public class BlockingCollection<T> : IEnumerable<T>, ICollection, IEnumerable, IDisposable
- {
- const int spinCount = 5;
-
- readonly IProducerConsumerCollection<T> underlyingColl;
-
- /* These events are used solely for the purpose of having an optimized sleep cycle when
- * the BlockingCollection have to wait on an external event (Add or Remove for instance)
- */
- ManualResetEventSlim mreAdd = new ManualResetEventSlim (true);
- ManualResetEventSlim mreRemove = new ManualResetEventSlim (true);
- AtomicBoolean isComplete;
-
- readonly int upperBound;
-
- int completeId;
-
- /* The whole idea of the collection is to use these two long values in a transactional
- * way to track and manage the actual data inside the underlying lock-free collection
- * instead of directly working with it or using external locking.
- *
- * They are manipulated with CAS and are guaranteed to increase over time and use
- * of the instance thus preventing ABA problems.
- */
- int addId = int.MinValue;
- int removeId = int.MinValue;
-
-
- /* For time based operations, we share this instance of Stopwatch and base calculation
- on a time offset at each of these method call */
- static Stopwatch watch = Stopwatch.StartNew ();
-
- #region ctors
- public BlockingCollection ()
- : this (new ConcurrentQueue<T> (), -1)
- {
- }
-
- public BlockingCollection (int boundedCapacity)
- : this (new ConcurrentQueue<T> (), boundedCapacity)
- {
- }
-
- public BlockingCollection (IProducerConsumerCollection<T> collection)
- : this (collection, -1)
- {
- }
-
- public BlockingCollection (IProducerConsumerCollection<T> collection, int boundedCapacity)
- {
- this.underlyingColl = collection;
- this.upperBound = boundedCapacity;
- this.isComplete = new AtomicBoolean ();
- }
- #endregion
-
- #region Add & Remove (+ Try)
- public void Add (T item)
- {
- Add (item, CancellationToken.None);
- }
-
- public void Add (T item, CancellationToken cancellationToken)
- {
- TryAdd (item, -1, cancellationToken);
- }
-
- public bool TryAdd (T item)
- {
- return TryAdd (item, 0, CancellationToken.None);
- }
-
- public bool TryAdd (T item, int millisecondsTimeout, CancellationToken cancellationToken)
- {
- if (millisecondsTimeout < -1)
- throw new ArgumentOutOfRangeException ("millisecondsTimeout");
-
- long start = millisecondsTimeout == -1 ? 0 : watch.ElapsedMilliseconds;
- SpinWait sw = new SpinWait ();
-
- do {
- cancellationToken.ThrowIfCancellationRequested ();
-
- int cachedAddId = addId;
- int cachedRemoveId = removeId;
- int itemsIn = cachedAddId - cachedRemoveId;
-
- // Check our transaction id against completed stored one
- if (isComplete.Value && cachedAddId >= completeId)
- ThrowCompleteException ();
-
- // If needed, we check and wait that the collection isn't full
- if (upperBound != -1 && itemsIn >= upperBound) {
- if (millisecondsTimeout == 0)
- return false;
-
- if (sw.Count <= spinCount) {
- sw.SpinOnce ();
- } else {
- mreRemove.Reset ();
- if (cachedRemoveId != removeId || cachedAddId != addId) {
- mreRemove.Set ();
- continue;
- }
-
- mreRemove.Wait (ComputeTimeout (millisecondsTimeout, start), cancellationToken);
- }
-
- continue;
- }
-
- // Validate the steps we have been doing until now
- if (Interlocked.CompareExchange (ref addId, cachedAddId + 1, cachedAddId) != cachedAddId)
- continue;
-
- // We have a slot reserved in the underlying collection, try to take it
- if (!underlyingColl.TryAdd (item))
- throw new InvalidOperationException ("The underlying collection didn't accept the item.");
-
- // Wake up process that may have been sleeping
- mreAdd.Set ();
-
- return true;
- } while (millisecondsTimeout == -1 || (watch.ElapsedMilliseconds - start) < millisecondsTimeout);
-
- return false;
- }
-
- public bool TryAdd (T item, TimeSpan timeout)
- {
- return TryAdd (item, (int)timeout.TotalMilliseconds);
- }
-
- public bool TryAdd (T item, int millisecondsTimeout)
- {
- return TryAdd (item, millisecondsTimeout, CancellationToken.None);
- }
-
- public T Take ()
- {
- return Take (CancellationToken.None);
- }
-
- public T Take (CancellationToken cancellationToken)
- {
- T item;
- TryTake (out item, -1, cancellationToken, true);
-
- return item;
- }
-
- public bool TryTake (out T item)
- {
- return TryTake (out item, 0, CancellationToken.None);
- }
-
- public bool TryTake (out T item, int millisecondsTimeout, CancellationToken cancellationToken)
- {
- return TryTake (out item, millisecondsTimeout, cancellationToken, false);
- }
-
- bool TryTake (out T item, int milliseconds, CancellationToken cancellationToken, bool throwComplete)
- {
- if (milliseconds < -1)
- throw new ArgumentOutOfRangeException ("milliseconds");
-
- item = default (T);
- SpinWait sw = new SpinWait ();
- long start = milliseconds == -1 ? 0 : watch.ElapsedMilliseconds;
-
- do {
- cancellationToken.ThrowIfCancellationRequested ();
-
- int cachedRemoveId = removeId;
- int cachedAddId = addId;
-
- // Empty case
- if (cachedRemoveId == cachedAddId) {
- if (milliseconds == 0)
- return false;
-
- if (IsCompleted) {
- if (throwComplete)
- ThrowCompleteException ();
- else
- return false;
- }
-
- if (sw.Count <= spinCount) {
- sw.SpinOnce ();
- } else {
- mreAdd.Reset ();
- if (cachedRemoveId != removeId || cachedAddId != addId) {
- mreAdd.Set ();
- continue;
- }
-
- mreAdd.Wait (ComputeTimeout (milliseconds, start), cancellationToken);
- }
-
- continue;
- }
-
- if (Interlocked.CompareExchange (ref removeId, cachedRemoveId + 1, cachedRemoveId) != cachedRemoveId)
- continue;
-
- while (!underlyingColl.TryTake (out item));
-
- mreRemove.Set ();
-
- return true;
-
- } while (milliseconds == -1 || (watch.ElapsedMilliseconds - start) < milliseconds);
-
- return false;
- }
-
- public bool TryTake (out T item, TimeSpan timeout)
- {
- return TryTake (out item, (int)timeout.TotalMilliseconds);
- }
-
- public bool TryTake (out T item, int millisecondsTimeout)
- {
- item = default (T);
-
- return TryTake (out item, millisecondsTimeout, CancellationToken.None, false);
- }
-
- static int ComputeTimeout (int millisecondsTimeout, long start)
- {
- return millisecondsTimeout == -1 ? 500 : (int)Math.Max (watch.ElapsedMilliseconds - start - millisecondsTimeout, 1);
- }
- #endregion
-
- #region static methods
- static void CheckArray (BlockingCollection<T>[] collections)
- {
- if (collections == null)
- throw new ArgumentNullException ("collections");
- if (collections.Length == 0 || IsThereANullElement (collections))
- throw new ArgumentException ("The collections argument is a 0-length array or contains a null element.", "collections");
- }
-
- static bool IsThereANullElement (BlockingCollection<T>[] collections)
- {
- foreach (BlockingCollection<T> e in collections)
- if (e == null)
- return true;
- return false;
- }
-
- public static int AddToAny (BlockingCollection<T>[] collections, T item)
- {
- return AddToAny (collections, item, CancellationToken.None);
- }
-
- public static int AddToAny (BlockingCollection<T>[] collections, T item, CancellationToken cancellationToken)
- {
- CheckArray (collections);
- WaitHandle[] wait_table = null;
- while (true) {
- for (int i = 0; i < collections.Length; ++i) {
- if (collections [i].TryAdd (item))
- return i;
- }
- cancellationToken.ThrowIfCancellationRequested ();
- if (wait_table == null) {
- wait_table = new WaitHandle [collections.Length + 1];
- for (int i = 0; i < collections.Length; ++i)
- wait_table [i] = collections [i].mreAdd.WaitHandle;
- wait_table [collections.Length] = cancellationToken.WaitHandle;
- }
- WaitHandle.WaitAny (wait_table);
- cancellationToken.ThrowIfCancellationRequested ();
- }
- }
-
- public static int TryAddToAny (BlockingCollection<T>[] collections, T item)
- {
- CheckArray (collections);
- int index = 0;
- foreach (var coll in collections) {
- if (coll.TryAdd (item))
- return index;
- index++;
- }
- return -1;
- }
-
- public static int TryAddToAny (BlockingCollection<T>[] collections, T item, TimeSpan timeout)
- {
- CheckArray (collections);
- int index = 0;
- foreach (var coll in collections) {
- if (coll.TryAdd (item, timeout))
- return index;
- index++;
- }
- return -1;
- }
-
- public static int TryAddToAny (BlockingCollection<T>[] collections, T item, int millisecondsTimeout)
- {
- CheckArray (collections);
- int index = 0;
- foreach (var coll in collections) {
- if (coll.TryAdd (item, millisecondsTimeout))
- return index;
- index++;
- }
- return -1;
- }
-
- public static int TryAddToAny (BlockingCollection<T>[] collections, T item, int millisecondsTimeout,
- CancellationToken cancellationToken)
- {
- CheckArray (collections);
- int index = 0;
- foreach (var coll in collections) {
- if (coll.TryAdd (item, millisecondsTimeout, cancellationToken))
- return index;
- index++;
- }
- return -1;
- }
-
- public static int TakeFromAny (BlockingCollection<T>[] collections, out T item)
- {
- return TakeFromAny (collections, out item, CancellationToken.None);
- }
-
- public static int TakeFromAny (BlockingCollection<T>[] collections, out T item, CancellationToken cancellationToken)
- {
- item = default (T);
- CheckArray (collections);
- WaitHandle[] wait_table = null;
- while (true) {
- for (int i = 0; i < collections.Length; ++i) {
- if (collections [i].TryTake (out item))
- return i;
- }
- cancellationToken.ThrowIfCancellationRequested ();
- if (wait_table == null) {
- wait_table = new WaitHandle [collections.Length + 1];
- for (int i = 0; i < collections.Length; ++i)
- wait_table [i] = collections [i].mreRemove.WaitHandle;
- wait_table [collections.Length] = cancellationToken.WaitHandle;
- }
- WaitHandle.WaitAny (wait_table);
- cancellationToken.ThrowIfCancellationRequested ();
- }
- }
-
- public static int TryTakeFromAny (BlockingCollection<T>[] collections, out T item)
- {
- item = default (T);
-
- CheckArray (collections);
- int index = 0;
- foreach (var coll in collections) {
- if (coll.TryTake (out item))
- return index;
- index++;
- }
- return -1;
- }
-
- public static int TryTakeFromAny (BlockingCollection<T>[] collections, out T item, TimeSpan timeout)
- {
- item = default (T);
-
- CheckArray (collections);
- int index = 0;
- foreach (var coll in collections) {
- if (coll.TryTake (out item, timeout))
- return index;
- index++;
- }
- return -1;
- }
-
- public static int TryTakeFromAny (BlockingCollection<T>[] collections, out T item, int millisecondsTimeout)
- {
- item = default (T);
-
- CheckArray (collections);
- int index = 0;
- foreach (var coll in collections) {
- if (coll.TryTake (out item, millisecondsTimeout))
- return index;
- index++;
- }
- return -1;
- }
-
- public static int TryTakeFromAny (BlockingCollection<T>[] collections, out T item, int millisecondsTimeout,
- CancellationToken cancellationToken)
- {
- item = default (T);
-
- CheckArray (collections);
- int index = 0;
- foreach (var coll in collections) {
- if (coll.TryTake (out item, millisecondsTimeout, cancellationToken))
- return index;
- index++;
- }
- return -1;
- }
- #endregion
-
- public void CompleteAdding ()
- {
- // No further add beside that point
- completeId = addId;
- isComplete.Value = true;
- // Wakeup some operation in case this has an impact
- mreAdd.Set ();
- mreRemove.Set ();
- }
-
- void ThrowCompleteException ()
- {
- throw new InvalidOperationException ("The BlockingCollection<T> has"
- + " been marked as complete with regards to additions.");
- }
-
- void ICollection.CopyTo (Array array, int index)
- {
- underlyingColl.CopyTo (array, index);
- }
-
- public void CopyTo (T[] array, int index)
- {
- underlyingColl.CopyTo (array, index);
- }
-
- public IEnumerable<T> GetConsumingEnumerable ()
- {
- return GetConsumingEnumerable (CancellationToken.None);
- }
-
- public IEnumerable<T> GetConsumingEnumerable (CancellationToken cancellationToken)
- {
- while (true) {
- T item = default (T);
-
- try {
- item = Take (cancellationToken);
- } catch {
- // Then the exception is perfectly normal
- if (IsCompleted)
- break;
- // otherwise rethrow
- throw;
- }
-
- yield return item;
- }
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return ((IEnumerable)underlyingColl).GetEnumerator ();
- }
-
- IEnumerator<T> IEnumerable<T>.GetEnumerator ()
- {
- return ((IEnumerable<T>)underlyingColl).GetEnumerator ();
- }
-
- public void Dispose ()
- {
-
- }
-
- protected virtual void Dispose (bool disposing)
- {
-
- }
-
- public T[] ToArray ()
- {
- return underlyingColl.ToArray ();
- }
-
- public int BoundedCapacity {
- get {
- return upperBound;
- }
- }
-
- public int Count {
- get {
- return underlyingColl.Count;
- }
- }
-
- public bool IsAddingCompleted {
- get {
- return isComplete.Value;
- }
- }
-
- public bool IsCompleted {
- get {
- return isComplete.Value && addId == removeId;
- }
- }
-
- object ICollection.SyncRoot {
- get {
- return underlyingColl.SyncRoot;
- }
- }
-
- bool ICollection.IsSynchronized {
- get {
- return underlyingColl.IsSynchronized;
- }
- }
- }
-}
-#endif
+++ /dev/null
-2010-06-03 Jérémie Laval <jeremie.laval@gmail.com>
-
- * ConcurrentBag.cs: Add a add hint cache for faster steal retrieval.
- Initialize lazily the underlying CyclicDeque.
-
-2010-04-15 Jérémie Laval <jeremie.laval@gmail.com>
-
- * BlockingCollection.cs:
- * ConcurrentBag.cs: Add BOOTSTRAP_NET_4_0
-
-2009-12-03 Marek Safar <marek.safar@gmail.com>
-
- * BlockingCollection.cs, ConcurrentBag.cs: Updated to Beta 2 API.
-
-2009-08-19 Jérémie Laval <jeremie.laval@gmail.com>
-
- * BlockingCollection.cs: Rewrite to use a transaction id
- based approach. Ported to 4.0 API. Fix GetConsumingEnumerable.
-
-2009-08-11 Jérémie Laval <jeremie.laval@gmail.com>
-
- * BlockingCollection.cs: New addition.
+++ /dev/null
-//
-// ConcurrentBag.cs
-//
-// Author:
-// Jérémie "Garuma" Laval <jeremie.laval@gmail.com>
-//
-// Copyright (c) 2009 Jérémie "Garuma" Laval
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#if NET_4_0
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace System.Collections.Concurrent
-{
- [ComVisible (false)]
- [DebuggerDisplay ("Count={Count}")]
- [DebuggerTypeProxy (typeof (CollectionDebuggerView<>))]
- public class ConcurrentBag<T> : IProducerConsumerCollection<T>, IEnumerable<T>, IEnumerable
- {
- // We store hints in an int
- int hints;
-
- int count;
- // The container area is where bag are added foreach thread
- ConcurrentDictionary<int, CyclicDeque<T>> container = new ConcurrentDictionary<int, CyclicDeque<T>> ();
- // The staging area is where non-empty bag are located for fast iteration
- ConcurrentDictionary<int, CyclicDeque<T>> staging = new ConcurrentDictionary<int, CyclicDeque<T>> ();
-
- public ConcurrentBag ()
- {
- }
-
- public ConcurrentBag (IEnumerable<T> collection) : this ()
- {
- foreach (T item in collection)
- Add (item);
- }
-
- public void Add (T item)
- {
- int index;
- CyclicDeque<T> bag = GetBag (out index);
- bag.PushBottom (item);
- staging.TryAdd (index, bag);
- AddHint (index);
- Interlocked.Increment (ref count);
- }
-
- bool IProducerConsumerCollection<T>.TryAdd (T element)
- {
- Add (element);
- return true;
- }
-
- public bool TryTake (out T result)
- {
- result = default (T);
-
- if (count == 0)
- return false;
-
- int hintIndex;
- CyclicDeque<T> bag = GetBag (out hintIndex, false);
- bool ret = true;
-
- if (bag == null || bag.PopBottom (out result) != PopResult.Succeed) {
- var self = bag;
- ret = false;
- foreach (var other in staging) {
- // Try to retrieve something based on a hint
- ret = TryGetHint (out hintIndex) && (bag = container[hintIndex]).PopTop (out result) == PopResult.Succeed;
-
- // We fall back to testing our slot
- if (!ret && other.Value != self) {
- var status = other.Value.PopTop (out result);
- while (status == PopResult.Abort)
- status = other.Value.PopTop (out result);
- ret = status == PopResult.Succeed;
- hintIndex = other.Key;
- bag = other.Value;
- }
-
- // If we found something, stop
- if (ret)
- break;
- }
- }
-
- if (ret) {
- TidyBag (hintIndex, bag);
- Interlocked.Decrement (ref count);
- }
-
- return ret;
- }
-
- public bool TryPeek (out T result)
- {
- result = default (T);
-
- if (count == 0)
- return false;
-
- int hintIndex;
- CyclicDeque<T> bag = GetBag (out hintIndex, false);
- bool ret = true;
-
- if (bag == null || !bag.PeekBottom (out result)) {
- var self = bag;
- ret = false;
- foreach (var other in staging) {
- // Try to retrieve something based on a hint
- ret = TryGetHint (out hintIndex) && container[hintIndex].PeekTop (out result);
-
- // We fall back to testing our slot
- if (!ret && other.Value != self)
- ret = other.Value.PeekTop (out result);
-
- // If we found something, stop
- if (ret)
- break;
- }
- }
-
- return ret;
- }
-
- void AddHint (int index)
- {
- // We only take thread index that can be stored in 5 bits (i.e. thread ids 1-15)
- if (index > 0xF)
- return;
- var hs = hints;
- // If cas failed then we don't retry
- Interlocked.CompareExchange (ref hints, (int)(((uint)hs) << 4 | (uint)index), (int)hs);
- }
-
- bool TryGetHint (out int index)
- {
- /* Funny little thing to know, since hints is signed (because CAS has no uint overload),
- * a shift-right operation is an arithmetic shift which might set high-order right bits
- * to 1 instead of 0 if the number turns negative.
- */
- var hs = hints;
- index = 0;
-
- if (Interlocked.CompareExchange (ref hints, (int)(((uint)hs) >> 4), hs) == hs)
- index = (int)(hs & 0xF);
-
- return index > 0;
- }
-
- public int Count {
- get {
- return count;
- }
- }
-
- public bool IsEmpty {
- get {
- return count == 0;
- }
- }
-
- object System.Collections.ICollection.SyncRoot {
- get {
- return this;
- }
- }
-
- bool System.Collections.ICollection.IsSynchronized {
- get {
- return true;
- }
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return GetEnumeratorInternal ();
- }
-
- public IEnumerator<T> GetEnumerator ()
- {
- return GetEnumeratorInternal ();
- }
-
- IEnumerator<T> GetEnumeratorInternal ()
- {
- foreach (var bag in container)
- foreach (T item in bag.Value.GetEnumerable ())
- yield return item;
- }
-
- void System.Collections.ICollection.CopyTo (Array array, int index)
- {
- T[] a = array as T[];
- if (a == null)
- return;
-
- CopyTo (a, index);
- }
-
- public void CopyTo (T[] array, int index)
- {
- int c = count;
- if (array.Length < c + index)
- throw new InvalidOperationException ("Array is not big enough");
-
- CopyTo (array, index, c);
- }
-
- void CopyTo (T[] array, int index, int num)
- {
- int i = index;
-
- foreach (T item in this) {
- if (i >= num)
- break;
-
- array[i++] = item;
- }
- }
-
- public T[] ToArray ()
- {
- int c = count;
- T[] temp = new T[c];
-
- CopyTo (temp, 0, c);
-
- return temp;
- }
-
- int GetIndex ()
- {
- return Thread.CurrentThread.ManagedThreadId;
- }
-
- CyclicDeque<T> GetBag (out int index, bool createBag = true)
- {
- index = GetIndex ();
- CyclicDeque<T> value;
- if (container.TryGetValue (index, out value))
- return value;
-
- return createBag ? container.GetOrAdd (index, new CyclicDeque<T> ()) : null;
- }
-
- void TidyBag (int index, CyclicDeque<T> bag)
- {
- if (bag != null && bag.IsEmpty) {
- if (staging.TryRemove (index, out bag) && !bag.IsEmpty)
- staging.TryAdd (index, bag);
- }
- }
- }
-}
-#endif
+++ /dev/null
-2010-04-09 Raja R Harinath <harinath@hurrynot.org>
-
- Don't maintain state in the view
- * SortedSet.cs (SortedSubSet.count): Remove.
- (SortedSubSet..ctor): Move counting loop ...
- (SortedSubSet.Count): ... here.
- (SortedSubSet.TryAdd, SortedSubSet.TryRemove): Update to changes.
- (SortedSubSet.GetMin, SortedSubSet.GetMax): Likewise. Use bounds
- to determine if the view is empty, rather than the count.
-
-2010-04-07 Raja R Harinath <harinath@hurrynot.org>
-
- Enable set comparision operations on views, and improve performance
- * RBTree.cs (Bound): New. Returns the greatest lower bound and
- least upper bound of the given key.
- (GetSuffixEnumerator): New. Returns an enumerator that starts at
- the given key.
- (NodeEnumerator): Provide suffix enumerator functionality.
- * SortedSet.cs (GetEnumerator): Delegate to ...
- (TryGetEnumerator): ... this. New virtual function.
- (Enumerator): Provide subset enumeration using RBTree's suffix enumerators.
- (SortedSubSet.count): New.
- (SortedSubSet.GetCount): Use it.
- (SortedSubSet.TryAdd, SortedSubSet.TryRemove): Update count.
- (SortedSubSet.GetMin, SortedSubSet.GetMax): Use RBTree.Bound().
- (SortedSubSet.GetEnumerator): Remove.
- (SortedSubSet.TryGetEnumerator): New. Use ranged enumerators.
-
-2010-04-06 Jb Evain <jbevain@novell.com>
-
- * SortedSet.cs: implement Count for SortedSubSet.
-
-2010-04-05 Raja R Harinath <harinath@hurrynot.org>
-
- * SortedSet.cs (IsProperSubsetOf, IsSubsetOf): Implement using ...
- (is_subset_of): ... new helper.
- (IsProperSupersetOf, IsSupersetOf): Implement using ...
- (is_superset_of): ... new helper.
- (covers, nodups, overlaps): New helpers.
- (SetEquals): Implement.
- (Overlaps): Implement using overlaps().
- (SymmetricExceptWith): Use nodups() helper.
-
-2010-04-04 Raja R Harinath <harinath@hurrynot.org>
-
- * SortedSet.cs (CheckArgumentNotNull): New helper.
- (IntersectWith, UnionWith): Implement.
- (ExceptWith, SymmetricExceptWith): Likewise.
- (SortedSubSet.IntersectWith): Implement override.
-
- * RBTree.cs (do_remove): Ensure the node returned is suitable for
- re-insertion.
-
-2010-04-02 Jb Evain <jbevain@novell.com>
-
- * SortedSet.cs: implement Mix and Max for subsets.
-
-2010-04-02 Jb Evain <jbevain@novell.com>
-
- * SortedSet.cs: implement GetViewBetween.
-
-2010-04-02 Jb Evain <jbevain@novell.com>
-
- * SortedSet.cs: optimize Reverse. Add a virtual TryAdd and TryRemove
- to override in sub trees.
-
-2010-04-02 Jb Evain <jbevain@novell.com>
-
- * SortedSet.cs: implement Min and Max.
-
-2010-04-02 Jb Evain <jbevain@novell.com>
-
- * SortedSet.cs: implement RemoveWhere.
-
-2010-04-02 Jb Evain <jbevain@novell.com>
-
- * SortedSet.cs: implement Reverse.
-
-2010-04-01 Jb Evain <jbevain@novell.com>
-
- * SortedSet.cs: fix API.
-
-2010-04-01 Jb Evain <jbevain@novell.com>
-
- * SortedSet.cs: add new SortedSet type in .net 4.0
-
-2010-03-03 Miguel de Icaza <miguel@novell.com>
-
- * RBTree.cs: Make these serializable, should fix the serialization
- across appdomains of SortedDictionaries
-
-2010-03-11 Sebastien Pouliot <sebastien@ximian.com>
-
- * ISet.cs: Add NET_2_1 since this is part of SL4
-
-2009-12-01 Jb Evain <jbevain@novell.com>
-
- * Stack.cs (Enumerator.Dispose): tag the enumerator as finished
- upon Dispose.
-
-2009-11-26 Marek Safar <marek.safar@gmail.com>
-
- * LinkedList.cs: Allocate less.
-
-2009-11-25 Jb Evain <jbevain@novell.com>
-
- * Queue.cs (Enqueue): deal with the case where the tail
- is off the array when deciding to enlarge the capacity.
-
-2009-11-25 Jb Evain <jbevain@novell.com>
-
- * Queue.cs (ICollection.CopyTo): fix typo, remove code duplication.
-
-2009-11-02 Miguel de Icaza <miguel@novell.com>
-
- * ISet.cs: Added new interface.
-
-2009-10-20 Marek Safar <marek.safar@gmail.com>
-
- * SortedList.cs, LinkedList.cs, Queue.cs, Stack.cs,
- SortedDictionary.cs: Improve debugging experience.
-
-2009-07-31 Raja R Harinath <harinath@hurrynot.org>
-
- * RBTree.cs (NodeEnumerator.check_current): New helper.
- (NodeEnumerator.Current): Don't check invariants.
- * SortedDictionary.cs (Enumerator.Current): Likewise.
- (ValueCollection.Enumerator.Current): Likewise.
- (KeyCollection.Enumerator.Current): Likewise.
-
-2009-07-26 Miguel de Icaza <miguel@novell.com>
-
- * Stack.cs: Check arguments.
-
-2009-07-14 Gonzalo Paniagua Javier <gonzalo@novell.com>
-
- * SortedList.cs: the IComparar.Compare arguments were reversed.
- Fixes bug #521750. Patch by Kevin Fitzgerald.
-
-2009-05-10 Andy Hume <andyhume32@yahoo.co.uk>
-
- * LinkedList.cs: Add null check. Fixes #481621.
-
-2009-03-11 Zoltan Varga <vargaz@gmail.com>
-
- * SortedList.cs: Add version checking to the Key/Value enumerators +
- implement support for Reset (). Fixes #483985.
-
-2009-05-06 Pia Eriksson <pe@hallerud.se>
-
- * SortedList.cs: Handle Count == 0 in CopyTo correcly
- * SortedDictionary.cs: Handle Count == 0 in CopyTo correcly
-
-2007-11-15 Roei Erez <roeie@mainsoft.com>
-
- * Stack.cs: Performance improvement in the case where the stack is popped
- until empty. Changed the condition for resizing the array, and instead of
- check for zero size, check if the inner array is null.
-
-2007-11-15 Jb Evain <jbevain@novell.com>
-
- * LinkedList.cs: ifdef out manually the Serialization part of the
- LinkedList.Enumerator. As it is a struct, the field SerializationInfo
- have to be assigned in the default constructor, and the tuner cannot
- remove that. Fixes #341938 for real.
-
-2007-10-09 Raja R Harinath <rharinath@novell.com>
-
- * RBTree.cs (get_Item, do_remove): Remove redundant code.
-
-2007-08-20 Jb Evain <jbevain@novell.com>
-
- * SortedList.cs: don't crash in ListKeys and ListValues
- when CopyTo targets an empty array, and that the
- sorted list is empty. Fixes #82492.
-
-2007-05-08 Raja R Harinath <rharinath@novell.com>
-
- Avoid unnecessary allocation on indexer access
- * SortedDictionary.cs (NodeHelper): Rename from NodeComparer.
- (NodeHelper.CreateNode): New.
- (Item.set): Move responsibility of creating new nodes to
- RBTree.Intern.
- * RBTree.cs (INodeHelper): Rename from INodeComparer.
- (INodeHelper.CreateNode): New.
- (Intern): Use it to create a new node if no node is passed in.
-
-2007-05-08 Igor Zelmanovich <igorz@mainsoft.com>
-
- * RBTree.cs: for TARGET_JVM used Thread Local Storage
- istead Thread-Relative Static Fields
-
-2007-05-02 Raja R Harinath <rharinath@novell.com>
-
- * RBTree.cs (Enumerator.Current): Remove nullref.
-
- * SortedDictionary.cs (ICollection.Contains): Use EqualityComparer
- for comparing the value field.
-
- * RBTree.cs (do_remove): Remove some redundant assignments/checks.
- (NodeEnumerator): Simplify. Keep track of a list of
- right-pennants that need to be traversed next, rather than
- comparing parent pointers.
-
-2007-05-02 Raja R Harinath <harinath@gmail.com>
-
- Make add and remove operations O(log n).
- * SortedDictionary.cs: Rewrite to use the red-black tree
- implementation from RBTree.cs.
- * RBTree.cs: Some more refactoring. Rename Insert() to Intern(),
- and modify semantics slightly. Replace Contains() with Lookup().
-
-2007-04-30 Raja R Harinath <rharinath@novell.com>
-
- * RBTree.cs: Refactor to reduce generics code.
-
-2007-04-30 Raja R Harinath <harinath@gmail.com>
-
- * RBTree.cs: New red-black tree implementation for use with
- SortedDictionary.
-
-2007-04-19 Gert Driesen <drieseng@users.sourceforge.net>
-
- * Queue.cs: Fixed binary serialization, based on patch provided by
- Lionel Cuir. Fixes TrimExcess to use SetCapacity, before it was not
- updating _head which could lead to IndexOutOfRangeException.
- * Stack.cs: Fixed binary serialization, based on patch provided by
- Lionel Cuir. In Pop, clear entry from array to help GC.
-
-2007-03-27 Alan McGovern <alan.mcgovern@gmail.com>
-
- * Queue.cs: Removed wrong call to version++
- * Stack.cs: Removed wrong call to version++
-
-2006-09-30 Gert Driesen <drieseng@users.sourceforge.net>
-
- * SortedList.cs: Count property, indexer and Clear method should not
- be virtual. Removed unnecessary explicit interface implementation of
- Add (TKey, TValue) and Remove (TKey, TValue).
- * Queue.cs: Marked Enumerator as Serializable.
- * Stack.cs: Marked Stack <T> and Enumerator as serializable.
-
-2006-09-28 Andrew Skiba <andrews@mainsoft.com>
-
- * Stack.cs: TARGET_JVM
-
-2006-04-05 Atsushi Enomoto <atsushi@ximian.com>
-
- * SortedDictionary.cs : new file. The original code is mostly
- from Kazuki Oikawa.
-
-2006-03-11 Miguel de Icaza <miguel@novell.com>
-
- * Queue.cs: Flag as serializable.
-
- * LinkedList.cs (OnDeserialization): Fix signature.
-
- * SortedList.cs: Implement explicitly a few methods that were
- flagged by corcompare.
-
-2005-11-10 Zoltan Varga <vargaz@gmail.com>
-
- * SortedList.cs Queue.cs Stack.cs: Implement TrimExcess methods.
-
- * SortedList.cs: Fix build.
-
- * Stack.cs SortedList.cs LinkedList.cs: Update to net 2.0 RTM.
-
-2005-11-09 Zoltan Varga <vargaz@gmail.com>
-
- * SortedList.cs: New file.
-
-2005-09-04 David Waite <mass@akuma.org>
-
- * LinkedList.cs, LinkedListNode.cs: added implementation of LinkedList<T>
-
-2005-08-08 Kamil Skalski <nazgul@nemerle.org>
-
- * Queue.cs, Stack.cs: remove implementation of ICollection<T>,
- since it is no longer in b2 API
-
-2005-06-20 David Waite <mass@akuma.org>
-
- * Collection.cs, ReadOnlyCollection.cs: removed as they are no longer in the b2 API
-
-2005-05-13 Atsushi Enomoto <atsushi@ximian.com>
-
- * Queue.cs, Stack.cs: moved from mscorlib.dll
-
-2005-02-35 Carlos Alberto Cortez <calberto.cortez@gmail.com>
-
- * Collections.cs: Changed the code inside IndexOf, for
- the use of Array.IndexOf<>, to keep clean the code.
-
-2004-11-17 Carlos Alberto Cortez Guevara <carlos@unixmexico.org>
-
- * Collections.cs: Avoid the call to Array.Clear () in RemoveItem (),
- now we only assign the last element (the deleted one) to its default
- value.
-
-2004-09-20 Gert Driesen <drieseng@users.sourceforge.net>
-
- * ReadOnlyCollection.cs: Moved over from corlib
- * Collection.cs: Moved over from corlib
+++ /dev/null
-//
-// System.Collections.Generic.ISet.cs
-//
-// Author:
-// Miguel de Icaza (miguel@gnome.org)
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-#if NET_4_0
-
-namespace System.Collections.Generic {
- public interface ISet<T> : ICollection<T>
- {
- new bool Add (T item);
- void ExceptWith (IEnumerable<T> other);
- void IntersectWith (IEnumerable<T> other);
- bool IsProperSubsetOf (IEnumerable<T> other);
- bool IsProperSupersetOf (IEnumerable<T> other);
- bool IsSubsetOf (IEnumerable<T> other);
- bool IsSupersetOf (IEnumerable<T> other);
- bool Overlaps (IEnumerable<T> other);
- bool SetEquals (IEnumerable<T> other);
- void SymmetricExceptWith (IEnumerable<T> other);
- void UnionWith (IEnumerable<T> other);
- }
-}
-#endif
+++ /dev/null
-//
-// System.Collections.Generic.LinkedList
-//
-// Author:
-// David Waite
-//
-// (C) 2005 David Waite (mass@akuma.org)
-//
-
-//
-// Copyright (C) 2005 David Waite
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-using System.Runtime.Serialization;
-using System.Security.Permissions;
-using System.Diagnostics;
-
-namespace System.Collections.Generic
-{
- [Serializable, ComVisible (false)]
- [DebuggerDisplay ("Count={Count}")]
- [DebuggerTypeProxy (typeof (CollectionDebuggerView<>))]
- public class LinkedList <T> : ICollection <T>, ICollection, ISerializable, IDeserializationCallback
- {
- const string DataArrayKey = "DataArray";
- const string VersionKey = "version";
- uint count, version;
-
- // Internally a circular list - first.back == last
- internal LinkedListNode <T> first;
- internal SerializationInfo si;
-
- public LinkedList ()
- {
- }
-
- public LinkedList (IEnumerable <T> collection)
- {
- foreach (T item in collection)
- AddLast (item);
- }
-
- protected LinkedList (SerializationInfo info, StreamingContext context)
- {
- si = info;
- }
-
- void VerifyReferencedNode (LinkedListNode <T> node)
- {
- if (node == null)
- throw new ArgumentNullException ("node");
-
- if (node.List != this)
- throw new InvalidOperationException ();
- }
-
- static void VerifyBlankNode (LinkedListNode <T> newNode)
- {
- if (newNode == null)
- throw new ArgumentNullException ("newNode");
-
- if (newNode.List != null)
- throw new InvalidOperationException ();
- }
-
- public LinkedListNode <T> AddAfter (LinkedListNode <T> node, T value)
- {
- VerifyReferencedNode (node);
- LinkedListNode <T> newNode = new LinkedListNode <T> (this, value, node, node.forward);
- count++;
- version++;
- return newNode;
- }
-
- public void AddAfter (LinkedListNode <T> node, LinkedListNode <T> newNode)
- {
- VerifyReferencedNode (node);
- VerifyBlankNode (newNode);
- newNode.InsertBetween (node, node.forward, this);
- count++;
- version++;
- }
-
- public LinkedListNode <T> AddBefore (LinkedListNode <T> node, T value)
- {
- VerifyReferencedNode (node);
- LinkedListNode <T> newNode = new LinkedListNode <T> (this, value, node.back, node);
- count++;
- version++;
-
- if (node == first)
- first = newNode;
- return newNode;
- }
-
- public void AddBefore (LinkedListNode <T> node, LinkedListNode <T> newNode)
- {
- VerifyReferencedNode (node);
- VerifyBlankNode (newNode);
- newNode.InsertBetween (node.back, node, this);
- count++;
- version++;
-
- if (node == first)
- first = newNode;
- }
-
- public void AddFirst (LinkedListNode <T> node)
- {
- VerifyBlankNode (node);
- if (first == null)
- node.SelfReference (this);
- else
- node.InsertBetween (first.back, first, this);
- count++;
- version++;
- first = node;
- }
-
- public LinkedListNode <T> AddFirst (T value)
- {
- LinkedListNode <T> newNode;
- if (first == null)
- newNode = new LinkedListNode <T> (this, value);
- else
- newNode = new LinkedListNode <T> (this, value, first.back, first);
- count++;
- version++;
- first = newNode;
- return newNode;
- }
-
- public LinkedListNode <T> AddLast (T value)
- {
- LinkedListNode <T> newNode;
- if (first == null)
- {
- newNode = new LinkedListNode <T> (this, value);
- first = newNode;
- }
- else
- newNode = new LinkedListNode <T> (this, value, first.back, first);
- count++;
- version++;
- return newNode;
- }
-
- public void AddLast (LinkedListNode <T> node)
- {
- VerifyBlankNode (node);
- if (first == null)
- {
- node.SelfReference (this);
- first = node;
- }
- else
- node.InsertBetween (first.back, first, this);
- count++;
- version++;
- }
-
- public void Clear ()
- {
- while (first != null)
- Remove (first);
- }
-
- public bool Contains (T value)
- {
- return Find (value) != null;
- }
-
- public void CopyTo (T [] array, int index)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
- if ( (uint) index < (uint) array.GetLowerBound (0))
- throw new ArgumentOutOfRangeException ("index");
- if (array.Rank != 1)
- throw new ArgumentException ("array", "Array is multidimensional");
- if (array.Length - index + array.GetLowerBound (0) < count)
- throw new ArgumentException ("number of items exceeds capacity");
-
- LinkedListNode <T> node = first;
- if (first == null)
- return;
- do
- {
- array [index] = node.Value;
- index++;
- node = node.forward;
- }
- while (node != first);
- }
-
- public LinkedListNode<T> Find (T value)
- {
- var node = first;
- if (node == null)
- return null;
-
- do {
- if (value == null) {
- if (node.Value == null)
- return node;
- } else {
- if (EqualityComparer<T>.Default.Equals (node.Value, value))
- return node;
- }
-
- node = node.forward;
- } while (node != first);
-
- return null;
- }
-
- public LinkedListNode<T> FindLast (T value)
- {
- var node = first;
- if (node == null)
- return null;
-
- do {
- node = node.back;
-
- if (value == null) {
- if (node.Value == null)
- return node;
- } else {
- if (EqualityComparer<T>.Default.Equals (node.Value, value))
- return node;
- }
- } while (node != first);
-
- return null;
- }
-
- public Enumerator GetEnumerator ()
- {
- return new Enumerator (this);
- }
-
- [SecurityPermission (SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.SerializationFormatter)]
- public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- T [] data = new T [count];
- CopyTo (data, 0);
- info.AddValue (DataArrayKey, data, typeof (T []));
- info.AddValue (VersionKey, version);
- }
-
- public virtual void OnDeserialization (object sender)
- {
- if (si != null)
- {
- T [] data = (T []) si.GetValue (DataArrayKey, typeof (T []));
- if (data != null)
- foreach (T item in data)
- AddLast (item);
- version = si.GetUInt32 (VersionKey);
- si = null;
- }
- }
-
- public bool Remove (T value)
- {
- LinkedListNode <T> node = Find (value);
- if (node == null)
- return false;
- Remove (node);
- return true;
- }
-
- public void Remove (LinkedListNode <T> node)
- {
- VerifyReferencedNode (node);
- count--;
- if (count == 0)
- first = null;
-
- if (node == first)
- first = first.forward;
-
- version++;
- node.Detach ();
- }
-
- public void RemoveFirst ()
- {
- if (first == null)
- throw new InvalidOperationException ();
-
- Remove (first);
- }
-
- public void RemoveLast ()
- {
- if (first == null)
- throw new InvalidOperationException ();
-
- Remove (first.back);
- }
-
- void ICollection <T>.Add (T value)
- {
- AddLast (value);
- }
-
- void ICollection.CopyTo (Array array, int index)
- {
- T [] Tarray = array as T [];
- if (Tarray == null)
- throw new ArgumentException ("array");
- CopyTo (Tarray, index);
- }
-
- IEnumerator <T> IEnumerable <T>.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- public int Count {
- get { return (int) count; }
- }
-
- public LinkedListNode <T> First {
- get { return first; }
- }
-
- public LinkedListNode <T> Last {
- get { return (first != null) ? first.back : null; }
- }
-
- bool ICollection <T>.IsReadOnly {
- get { return false; }
- }
-
- bool ICollection.IsSynchronized {
- get { return false; }
- }
-
- object ICollection.SyncRoot {
- get { return this; }
- }
-
- [Serializable, StructLayout (LayoutKind.Sequential)]
- public struct Enumerator : IEnumerator <T>, IDisposable, IEnumerator
-#if !NET_2_1
- , ISerializable, IDeserializationCallback
-#endif
- {
- const String VersionKey = "version";
- const String IndexKey = "index";
- const String ListKey = "list";
-
- LinkedList <T> list;
- LinkedListNode <T> current;
- int index;
- uint version;
-#if !NET_2_1
- SerializationInfo si;
-
- internal Enumerator (SerializationInfo info, StreamingContext context)
- {
- si = info;
- list = (LinkedList <T>) si.GetValue (ListKey, typeof (LinkedList <T>));
- index = si.GetInt32 (IndexKey);
- version = si.GetUInt32 (VersionKey);
- current = null;
- }
-#endif
-
- internal Enumerator (LinkedList <T> parent)
- {
-#if !NET_2_1
- si = null;
-#endif
- this.list = parent;
- current = null;
- index = -1;
- version = parent.version;
- }
-
- public T Current {
- get {
- if (list == null)
- throw new ObjectDisposedException (null);
- if (current == null)
- throw new InvalidOperationException ();
- return current.Value;
- }
- }
-
- object IEnumerator.Current {
- get { return Current; }
- }
-
- public bool MoveNext ()
- {
- if (list == null)
- throw new ObjectDisposedException (null);
- if (version != list.version)
- throw new InvalidOperationException ("list modified");
-
- if (current == null) {
- if (index < 0)
- current = list.first;
- } else {
- current = current.forward;
- if (current == list.first)
- current = null;
- }
-
- if (current == null) {
- index = int.MaxValue;
- return false;
- }
-
- ++index;
- return true;
- }
-
- void IEnumerator.Reset ()
- {
- if (list == null)
- throw new ObjectDisposedException (null);
- if (version != list.version)
- throw new InvalidOperationException ("list modified");
-
- current = null;
- index = -1;
- }
-
- public void Dispose ()
- {
- if (list == null)
- throw new ObjectDisposedException (null);
- current = null;
- list = null;
- }
-
-#if !NET_2_1
- [SecurityPermission (SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.SerializationFormatter)]
- void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
- {
- if (list == null)
- throw new ObjectDisposedException (null);
- info.AddValue (VersionKey, version);
- info.AddValue (IndexKey, index);
- }
-
- void IDeserializationCallback.OnDeserialization (object sender)
- {
- if (si == null)
- return;
-
- if (list.si != null)
- ( (IDeserializationCallback) list).OnDeserialization (this);
-
- si = null;
-
- if (version == list.version && index != -1)
- {
- LinkedListNode <T> node = list.First;
-
- for (int i = 0; i < index; i++)
- node = node.forward;
-
- current = node;
- }
- }
-#endif
- }
- }
-}
+++ /dev/null
-//
-// System.Collections.Generic.LinkedListNode
-//
-// Author:
-// David Waite
-//
-// (C) 2005 David Waite (mass@akuma.org)
-//
-
-//
-// Copyright (C) 2005 David Waite
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace System.Collections.Generic
-{
- [ComVisible (false)]
- public sealed class LinkedListNode <T>
- {
- T item;
- LinkedList <T> container;
-
- internal LinkedListNode <T> forward, back;
-
- public LinkedListNode (T value)
- {
- item = value;
- }
-
- internal LinkedListNode (LinkedList <T> list, T value)
- {
- container = list;
- item = value;
- this.back = this.forward = this;
- }
-
- internal LinkedListNode (LinkedList <T> list, T value, LinkedListNode <T> previousNode, LinkedListNode <T> nextNode)
- {
- container = list;
- item = value;
- this.back = previousNode;
- this.forward = nextNode;
- previousNode.forward = this;
- nextNode.back = this;
- }
-
- internal void Detach ()
- {
- back.forward = forward;
- forward.back = back;
-
- forward = back = null;
- container = null;
- }
-
- internal void SelfReference (LinkedList <T> list)
- {
- forward = this;
- back = this;
- container = list;
- }
-
- internal void InsertBetween (LinkedListNode <T> previousNode, LinkedListNode <T> nextNode, LinkedList <T> list)
- {
- previousNode.forward = this;
- nextNode.back = this;
- this.forward = nextNode;
- this.back = previousNode;
- this.container = list;
- }
-
- public LinkedList <T> List {
- get { return container; }
- }
-
- public LinkedListNode <T> Next {
- get { return (container != null && forward != container.first) ? forward : null; }
- }
-
- public LinkedListNode <T> Previous {
- get { return (container != null && this != container.first) ? back : null ; }
- }
-
- public T Value {
- get { return item; }
- set { item = value; }
- }
- }
-}
+++ /dev/null
-//
-// System.Collections.Generic.Queue
-//
-// Author:
-// Martin Baulig (martin@ximian.com)
-// Ben Maurer (bmaurer@ximian.com)
-//
-// (C) 2003, 2004 Novell, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-using System.Diagnostics;
-
-namespace System.Collections.Generic
-{
- [ComVisible(false)]
- [Serializable]
- [DebuggerDisplay ("Count={Count}")]
- [DebuggerTypeProxy (typeof (CollectionDebuggerView))]
- public class Queue<T> : IEnumerable <T>, ICollection, IEnumerable
- {
- T [] _array;
- int _head;
- int _tail;
- int _size;
- int _version;
-
- public Queue ()
- {
- _array = new T [0];
- }
-
- public Queue (int capacity)
- {
- if (capacity < 0)
- throw new ArgumentOutOfRangeException ("capacity");
-
- _array = new T [capacity];
- }
-
- public Queue (IEnumerable <T> collection)
- {
- if (collection == null)
- throw new ArgumentNullException ("collection");
-
- var icoll = collection as ICollection<T>;
- var size = icoll != null ? icoll.Count : 0;
-
- _array = new T [size];
-
- foreach (T t in collection)
- Enqueue (t);
- }
-
- public void Clear ()
- {
- Array.Clear (_array, 0, _array.Length);
-
- _head = _tail = _size = 0;
- _version++;
- }
-
- public bool Contains (T item)
- {
- if (item == null) {
- foreach (T t in this)
- if (t == null)
- return true;
- } else {
- foreach (T t in this)
- if (item.Equals (t))
- return true;
- }
-
- return false;
- }
-
- public void CopyTo (T [] array, int arrayIndex)
- {
- if (array == null)
- throw new ArgumentNullException ();
-
- ((ICollection) this).CopyTo (array, arrayIndex);
- }
-
- void ICollection.CopyTo (Array array, int idx)
- {
- if (array == null)
- throw new ArgumentNullException ();
-
- if ((uint) idx > (uint) array.Length)
- throw new ArgumentOutOfRangeException ();
-
- if (array.Length - idx < _size)
- throw new ArgumentOutOfRangeException ();
-
- if (_size == 0)
- return;
-
- try {
- int contents_length = _array.Length;
- int length_from_head = contents_length - _head;
-
- Array.Copy (_array, _head, array, idx, Math.Min (_size, length_from_head));
- if (_size > length_from_head)
- Array.Copy (_array, 0, array,
- idx + length_from_head,
- _size - length_from_head);
- } catch (ArrayTypeMismatchException) {
- throw new ArgumentException ();
- }
- }
-
- public T Dequeue ()
- {
- T ret = Peek ();
-
- // clear stuff out to make the GC happy
- _array [_head] = default (T);
-
- if (++_head == _array.Length)
- _head = 0;
- _size --;
- _version ++;
-
- return ret;
- }
-
- public T Peek ()
- {
- if (_size == 0)
- throw new InvalidOperationException ();
-
- return _array [_head];
- }
-
- public void Enqueue (T item)
- {
- if (_size == _array.Length || _tail == _array.Length)
- SetCapacity (Math.Max (Math.Max (_size, _tail) * 2, 4));
-
- _array [_tail] = item;
-
- if (++_tail == _array.Length)
- _tail = 0;
-
- _size ++;
- _version ++;
- }
-
- public T [] ToArray ()
- {
- T [] t = new T [_size];
- CopyTo (t, 0);
- return t;
- }
-
- public void TrimExcess ()
- {
- if (_size < _array.Length * 0.9)
- SetCapacity (_size);
- }
-
- void SetCapacity (int new_size)
- {
- if (new_size == _array.Length)
- return;
-
- if (new_size < _size)
- throw new InvalidOperationException ("shouldnt happen");
-
- T [] new_data = new T [new_size];
- if (_size > 0)
- CopyTo (new_data, 0);
-
- _array = new_data;
- _tail = _size;
- _head = 0;
- _version ++;
- }
-
- public int Count {
- get { return _size; }
- }
-
- bool ICollection.IsSynchronized {
- get { return false; }
- }
-
- object ICollection.SyncRoot {
- get { return this; }
- }
-
- public Enumerator GetEnumerator ()
- {
- return new Enumerator (this);
- }
-
- IEnumerator <T> IEnumerable<T>.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- [Serializable]
- public struct Enumerator : IEnumerator <T>, IEnumerator, IDisposable {
- const int NOT_STARTED = -2;
-
- // this MUST be -1, because we depend on it in move next.
- // we just decr the _size, so, 0 - 1 == FINISHED
- const int FINISHED = -1;
-
- Queue <T> q;
- int idx;
- int ver;
-
- internal Enumerator (Queue <T> q)
- {
- this.q = q;
- idx = NOT_STARTED;
- ver = q._version;
- }
-
- // for some reason, MSFT added a dispose to this class
- // It means that in foreach, we must still do a try/finally. Broken?
- public void Dispose ()
- {
- idx = NOT_STARTED;
- }
-
- public bool MoveNext ()
- {
- if (ver != q._version)
- throw new InvalidOperationException ();
-
- if (idx == NOT_STARTED)
- idx = q._size;
-
- return idx != FINISHED && -- idx != FINISHED;
- }
-
- public T Current {
- get {
- if (idx < 0)
- throw new InvalidOperationException ();
-
- return q._array [(q._size - 1 - idx + q._head) % q._array.Length];
- }
- }
-
- void IEnumerator.Reset ()
- {
- if (ver != q._version)
- throw new InvalidOperationException ();
-
- idx = NOT_STARTED;
- }
-
- object IEnumerator.Current {
- get { return Current; }
- }
-
- }
- }
-}
+++ /dev/null
-//
-// System.Collections.Generic.RBTree
-//
-// Authors:
-// Raja R Harinath <rharinath@novell.com>
-//
-
-//
-// Copyright (C) 2007, Novell, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#define ONE_MEMBER_CACHE
-
-using System;
-using System.Collections;
-
-namespace System.Collections.Generic
-{
- [Serializable]
- internal class RBTree : IEnumerable, IEnumerable<RBTree.Node> {
- public interface INodeHelper<T> {
- int Compare (T key, Node node);
- Node CreateNode (T key);
- }
-
- public abstract class Node {
- public Node left, right;
- uint size_black;
-
- const uint black_mask = 1;
- const int black_shift = 1;
- public bool IsBlack {
- get { return (size_black & black_mask) == black_mask; }
- set { size_black = value ? (size_black | black_mask) : (size_black & ~black_mask); }
- }
-
- public uint Size {
- get { return size_black >> black_shift; }
- set { size_black = (value << black_shift) | (size_black & black_mask); }
- }
-
- public uint FixSize ()
- {
- Size = 1;
- if (left != null)
- Size += left.Size;
- if (right != null)
- Size += right.Size;
- return Size;
- }
-
- public Node ()
- {
- size_black = 2; // Size == 1, IsBlack = false
- }
-
- public abstract void SwapValue (Node other);
-
-#if TEST
- public int VerifyInvariants ()
- {
- int black_depth_l = 0;
- int black_depth_r = 0;
- uint size = 1;
- bool child_is_red = false;
- if (left != null) {
- black_depth_l = left.VerifyInvariants ();
- size += left.Size;
- child_is_red |= !left.IsBlack;
- }
-
- if (right != null) {
- black_depth_r = right.VerifyInvariants ();
- size += right.Size;
- child_is_red |= !right.IsBlack;
- }
-
- if (black_depth_l != black_depth_r)
- throw new SystemException ("Internal error: black depth mismatch");
-
- if (!IsBlack && child_is_red)
- throw new SystemException ("Internal error: red-red conflict");
- if (Size != size)
- throw new SystemException ("Internal error: metadata error");
-
- return black_depth_l + (IsBlack ? 1 : 0);
- }
-
- public abstract void Dump (string indent);
-#endif
- }
-
- Node root;
- object hlp;
- uint version;
-
-#if ONE_MEMBER_CACHE
- [ThreadStatic]
- static List<Node> cached_path;
-
- static List<Node> alloc_path ()
- {
- if (cached_path == null)
- return new List<Node> ();
-
- List<Node> path = cached_path;
- cached_path = null;
- return path;
- }
-
- static void release_path (List<Node> path)
- {
- if (cached_path == null || cached_path.Capacity < path.Capacity) {
- path.Clear ();
- cached_path = path;
- }
- }
-#else
- static List<Node> alloc_path ()
- {
- return new List<Node> ();
- }
-
- static void release_path (List<Node> path)
- {
- }
-#endif
-
- public RBTree (object hlp)
- {
- // hlp is INodeHelper<T> for some T
- this.hlp = hlp;
- }
-
- public void Clear ()
- {
- root = null;
- ++version;
- }
-
- // if key is already in the tree, return the node associated with it
- // if not, insert new_node into the tree, and return it
- public Node Intern<T> (T key, Node new_node)
- {
- if (root == null) {
- if (new_node == null)
- new_node = ((INodeHelper<T>) hlp).CreateNode (key);
- root = new_node;
- root.IsBlack = true;
- ++version;
- return root;
- }
-
- List<Node> path = alloc_path ();
- int in_tree_cmp = find_key (key, path);
- Node retval = path [path.Count - 1];
- if (retval == null) {
- if (new_node == null)
- new_node = ((INodeHelper<T>) hlp).CreateNode (key);
- retval = do_insert (in_tree_cmp, new_node, path);
- }
- // no need for a try .. finally, this is only used to mitigate allocations
- release_path (path);
- return retval;
- }
-
- // returns the just-removed node (or null if the value wasn't in the tree)
- public Node Remove<T> (T key)
- {
- if (root == null)
- return null;
-
- List<Node> path = alloc_path ();
- int in_tree_cmp = find_key (key, path);
- Node retval = null;
- if (in_tree_cmp == 0)
- retval = do_remove (path);
- // no need for a try .. finally, this is only used to mitigate allocations
- release_path (path);
- return retval;
- }
-
- public Node Lookup<T> (T key)
- {
- INodeHelper<T> hlp = (INodeHelper<T>) this.hlp;
- Node current = root;
- while (current != null) {
- int c = hlp.Compare (key, current);
- if (c == 0)
- break;
- current = c < 0 ? current.left : current.right;
- }
- return current;
- }
-
- public void Bound<T> (T key, ref Node lower, ref Node upper)
- {
- INodeHelper<T> hlp = (INodeHelper<T>) this.hlp;
- Node current = root;
- while (current != null) {
- int c = hlp.Compare (key, current);
- if (c <= 0)
- upper = current;
- if (c >= 0)
- lower = current;
- if (c == 0)
- break;
- current = c < 0 ? current.left : current.right;
- }
- }
-
- public int Count {
- get { return root == null ? 0 : (int) root.Size; }
- }
-
- public Node this [int index] {
- get {
- if (index < 0 || index >= Count)
- throw new IndexOutOfRangeException ("index");
-
- Node current = root;
- while (current != null) {
- int left_size = current.left == null ? 0 : (int) current.left.Size;
- if (index == left_size)
- return current;
- if (index < left_size) {
- current = current.left;
- } else {
- index -= left_size + 1;
- current = current.right;
- }
- }
- throw new SystemException ("Internal Error: index calculation");
- }
- }
-
- public NodeEnumerator GetEnumerator ()
- {
- return new NodeEnumerator (this);
- }
-
- // Get an enumerator that starts at 'key' or the next higher element in the tree
- public NodeEnumerator GetSuffixEnumerator<T> (T key)
- {
- var pennants = new Stack<Node> ();
- INodeHelper<T> hlp = (INodeHelper<T>) this.hlp;
- Node current = root;
- while (current != null) {
- int c = hlp.Compare (key, current);
- if (c <= 0)
- pennants.Push (current);
- if (c == 0)
- break;
- current = c < 0 ? current.left : current.right;
- }
- return new NodeEnumerator (this, pennants);
- }
-
- IEnumerator<Node> IEnumerable<Node>.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
-#if TEST
- public void VerifyInvariants ()
- {
- if (root != null) {
- if (!root.IsBlack)
- throw new SystemException ("Internal Error: root is not black");
- root.VerifyInvariants ();
- }
- }
-
- public void Dump ()
- {
- if (root != null)
- root.Dump ("");
- }
-#endif
-
- // Pre-condition: root != null
- int find_key<T> (T key, List<Node> path)
- {
- INodeHelper<T> hlp = (INodeHelper<T>) this.hlp;
- int c = 0;
- Node sibling = null;
- Node current = root;
-
- if (path != null)
- path.Add (root);
-
- while (current != null) {
- c = hlp.Compare (key, current);
- if (c == 0)
- return c;
-
- if (c < 0) {
- sibling = current.right;
- current = current.left;
- } else {
- sibling = current.left;
- current = current.right;
- }
-
- if (path != null) {
- path.Add (sibling);
- path.Add (current);
- }
- }
-
- return c;
- }
-
- Node do_insert (int in_tree_cmp, Node current, List<Node> path)
- {
- path [path.Count - 1] = current;
- Node parent = path [path.Count - 3];
-
- if (in_tree_cmp < 0)
- parent.left = current;
- else
- parent.right = current;
- for (int i = 0; i < path.Count - 2; i += 2)
- ++ path [i].Size;
-
- if (!parent.IsBlack)
- rebalance_insert (path);
-
- if (!root.IsBlack)
- throw new SystemException ("Internal error: root is not black");
-
- ++version;
- return current;
- }
-
- Node do_remove (List<Node> path)
- {
- int curpos = path.Count - 1;
-
- Node current = path [curpos];
- if (current.left != null) {
- Node pred = right_most (current.left, current.right, path);
- current.SwapValue (pred);
- if (pred.left != null) {
- Node ppred = pred.left;
- path.Add (null); path.Add (ppred);
- pred.SwapValue (ppred);
- }
- } else if (current.right != null) {
- Node succ = current.right;
- path.Add (null); path.Add (succ);
- current.SwapValue (succ);
- }
-
- curpos = path.Count - 1;
- current = path [curpos];
-
- if (current.Size != 1)
- throw new SystemException ("Internal Error: red-black violation somewhere");
-
- // remove it from our data structures
- path [curpos] = null;
- node_reparent (curpos == 0 ? null : path [curpos-2], current, 0, null);
-
- for (int i = 0; i < path.Count - 2; i += 2)
- -- path [i].Size;
-
- if (current.IsBlack) {
- current.IsBlack = false;
- if (curpos != 0)
- rebalance_delete (path);
- }
-
- if (root != null && !root.IsBlack)
- throw new SystemException ("Internal Error: root is not black");
-
- ++version;
- return current;
- }
-
- // Pre-condition: current is red
- void rebalance_insert (List<Node> path)
- {
- int curpos = path.Count - 1;
- do {
- // parent == curpos-2, uncle == curpos-3, grandpa == curpos-4
- if (path [curpos-3] == null || path [curpos-3].IsBlack) {
- rebalance_insert__rotate_final (curpos, path);
- return;
- }
-
- path [curpos-2].IsBlack = path [curpos-3].IsBlack = true;
-
- curpos -= 4; // move to the grandpa
-
- if (curpos == 0) // => current == root
- return;
- path [curpos].IsBlack = false;
- } while (!path [curpos-2].IsBlack);
- }
-
- // Pre-condition: current is black
- void rebalance_delete (List<Node> path)
- {
- int curpos = path.Count - 1;
- do {
- Node sibling = path [curpos-1];
- // current is black => sibling != null
- if (!sibling.IsBlack) {
- // current is black && sibling is red
- // => both sibling.left and sibling.right are black, and are not null
- curpos = ensure_sibling_black (curpos, path);
- // one of the nephews became the new sibling -- in either case, sibling != null
- sibling = path [curpos-1];
- }
-
- if ((sibling.left != null && !sibling.left.IsBlack) ||
- (sibling.right != null && !sibling.right.IsBlack)) {
- rebalance_delete__rotate_final (curpos, path);
- return;
- }
-
- sibling.IsBlack = false;
-
- curpos -= 2; // move to the parent
-
- if (curpos == 0)
- return;
- } while (path [curpos].IsBlack);
- path [curpos].IsBlack = true;
- }
-
- void rebalance_insert__rotate_final (int curpos, List<Node> path)
- {
- Node current = path [curpos];
- Node parent = path [curpos-2];
- Node grandpa = path [curpos-4];
-
- uint grandpa_size = grandpa.Size;
-
- Node new_root;
-
- bool l1 = parent == grandpa.left;
- bool l2 = current == parent.left;
- if (l1 && l2) {
- grandpa.left = parent.right; parent.right = grandpa;
- new_root = parent;
- } else if (l1 && !l2) {
- grandpa.left = current.right; current.right = grandpa;
- parent.right = current.left; current.left = parent;
- new_root = current;
- } else if (!l1 && l2) {
- grandpa.right = current.left; current.left = grandpa;
- parent.left = current.right; current.right = parent;
- new_root = current;
- } else { // (!l1 && !l2)
- grandpa.right = parent.left; parent.left = grandpa;
- new_root = parent;
- }
-
- grandpa.FixSize (); grandpa.IsBlack = false;
- if (new_root != parent)
- parent.FixSize (); /* parent is red already, so no need to set it */
-
- new_root.IsBlack = true;
- node_reparent (curpos == 4 ? null : path [curpos-6], grandpa, grandpa_size, new_root);
- }
-
- // Pre-condition: sibling is black, and one of sibling.left and sibling.right is red
- void rebalance_delete__rotate_final (int curpos, List<Node> path)
- {
- //Node current = path [curpos];
- Node sibling = path [curpos-1];
- Node parent = path [curpos-2];
-
- uint parent_size = parent.Size;
- bool parent_was_black = parent.IsBlack;
-
- Node new_root;
- if (parent.right == sibling) {
- // if far nephew is black
- if (sibling.right == null || sibling.right.IsBlack) {
- // => near nephew is red, move it up
- Node nephew = sibling.left;
- parent.right = nephew.left; nephew.left = parent;
- sibling.left = nephew.right; nephew.right = sibling;
- new_root = nephew;
- } else {
- parent.right = sibling.left; sibling.left = parent;
- sibling.right.IsBlack = true;
- new_root = sibling;
- }
- } else {
- // if far nephew is black
- if (sibling.left == null || sibling.left.IsBlack) {
- // => near nephew is red, move it up
- Node nephew = sibling.right;
- parent.left = nephew.right; nephew.right = parent;
- sibling.right = nephew.left; nephew.left = sibling;
- new_root = nephew;
- } else {
- parent.left = sibling.right; sibling.right = parent;
- sibling.left.IsBlack = true;
- new_root = sibling;
- }
- }
-
- parent.FixSize (); parent.IsBlack = true;
- if (new_root != sibling)
- sibling.FixSize (); /* sibling is already black, so no need to set it */
-
- new_root.IsBlack = parent_was_black;
- node_reparent (curpos == 2 ? null : path [curpos-4], parent, parent_size, new_root);
- }
-
- // Pre-condition: sibling is red (=> parent, sibling.left and sibling.right are black)
- int ensure_sibling_black (int curpos, List<Node> path)
- {
- Node current = path [curpos];
- Node sibling = path [curpos-1];
- Node parent = path [curpos-2];
-
- bool current_on_left;
- uint parent_size = parent.Size;
-
- if (parent.right == sibling) {
- parent.right = sibling.left; sibling.left = parent;
- current_on_left = true;
- } else {
- parent.left = sibling.right; sibling.right = parent;
- current_on_left = false;
- }
-
- parent.FixSize (); parent.IsBlack = false;
-
- sibling.IsBlack = true;
- node_reparent (curpos == 2 ? null : path [curpos-4], parent, parent_size, sibling);
-
- // accomodate the rotation
- if (curpos+1 == path.Count) {
- path.Add (null);
- path.Add (null);
- }
-
- path [curpos-2] = sibling;
- path [curpos-1] = current_on_left ? sibling.right : sibling.left;
- path [curpos] = parent;
- path [curpos+1] = current_on_left ? parent.right : parent.left;
- path [curpos+2] = current;
-
- return curpos + 2;
- }
-
- void node_reparent (Node orig_parent, Node orig, uint orig_size, Node updated)
- {
- if (updated != null && updated.FixSize () != orig_size)
- throw new SystemException ("Internal error: rotation");
-
- if (orig == root)
- root = updated;
- else if (orig == orig_parent.left)
- orig_parent.left = updated;
- else if (orig == orig_parent.right)
- orig_parent.right = updated;
- else
- throw new SystemException ("Internal error: path error");
- }
-
- // Pre-condition: current != null
- static Node right_most (Node current, Node sibling, List<Node> path)
- {
- for (;;) {
- path.Add (sibling);
- path.Add (current);
- if (current.right == null)
- return current;
- sibling = current.left;
- current = current.right;
- }
- }
-
- [Serializable]
- public struct NodeEnumerator : IEnumerator, IEnumerator<Node> {
- RBTree tree;
- uint version;
-
- Stack<Node> pennants, init_pennants;
-
- internal NodeEnumerator (RBTree tree)
- : this ()
- {
- this.tree = tree;
- version = tree.version;
- }
-
- internal NodeEnumerator (RBTree tree, Stack<Node> init_pennants)
- : this (tree)
- {
- this.init_pennants = init_pennants;
- }
-
- public void Reset ()
- {
- check_version ();
- pennants = null;
- }
-
- public Node Current {
- get { return pennants.Peek (); }
- }
-
- object IEnumerator.Current {
- get {
- check_current ();
- return Current;
- }
- }
-
- public bool MoveNext ()
- {
- check_version ();
-
- Node next;
- if (pennants == null) {
- if (tree.root == null)
- return false;
- if (init_pennants != null) {
- pennants = init_pennants;
- init_pennants = null;
- return pennants.Count != 0;
- }
- pennants = new Stack<Node> ();
- next = tree.root;
- } else {
- if (pennants.Count == 0)
- return false;
- Node current = pennants.Pop ();
- next = current.right;
- }
- for (; next != null; next = next.left)
- pennants.Push (next);
-
- return pennants.Count != 0;
- }
-
- public void Dispose ()
- {
- tree = null;
- pennants = null;
- }
-
- void check_version ()
- {
- if (tree == null)
- throw new ObjectDisposedException ("enumerator");
- if (version != tree.version)
- throw new InvalidOperationException ("tree modified");
- }
-
- internal void check_current ()
- {
- check_version ();
- if (pennants == null || pennants.Count == 0)
- throw new InvalidOperationException ("Enumerator is before the first element or after the last element");
- }
- }
- }
-}
-
-#if TEST
-namespace Mono.ValidationTest {
- using System.Collections.Generic;
-
- internal class TreeSet<T> : IEnumerable<T>, IEnumerable
- {
- public class Node : RBTree.Node {
- public T value;
-
- public Node (T v)
- {
- value = v;
- }
-
- public override void SwapValue (RBTree.Node other)
- {
- Node o = (Node) other;
- T v = value;
- value = o.value;
- o.value = v;
- }
-
- public override void Dump (string indent)
- {
- Console.WriteLine ("{0}{1} {2}({3})", indent, value, IsBlack ? "*" : "", Size);
- if (left != null)
- left.Dump (indent + " /");
- if (right != null)
- right.Dump (indent + " \\");
- }
- }
-
- public class NodeHelper : RBTree.INodeHelper<T> {
- IComparer<T> cmp;
-
- public int Compare (T value, RBTree.Node node)
- {
- return cmp.Compare (value, ((Node) node).value);
- }
-
- public RBTree.Node CreateNode (T value)
- {
- return new Node (value);
- }
-
- private NodeHelper (IComparer<T> cmp)
- {
- this.cmp = cmp;
- }
- static NodeHelper Default = new NodeHelper (Comparer<T>.Default);
- public static NodeHelper GetHelper (IComparer<T> cmp)
- {
- if (cmp == null || cmp == Comparer<T>.Default)
- return Default;
- return new NodeHelper (cmp);
- }
- }
-
- public struct Enumerator : IDisposable, IEnumerator, IEnumerator<T> {
- RBTree.NodeEnumerator host;
-
- internal Enumerator (TreeSet<T> tree)
- {
- host = new RBTree.NodeEnumerator (tree.tree);
- }
-
- void IEnumerator.Reset ()
- {
- host.Reset ();
- }
-
- public T Current {
- get { return ((Node) host.Current).value; }
- }
-
- object IEnumerator.Current {
- get { return Current; }
- }
-
- public bool MoveNext ()
- {
- return host.MoveNext ();
- }
-
- public void Dispose ()
- {
- host.Dispose ();
- }
- }
-
- RBTree tree;
-
- public TreeSet () : this (null)
- {
- }
-
- public TreeSet (IComparer<T> cmp)
- {
- tree = new RBTree (NodeHelper.GetHelper (cmp));
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- IEnumerator<T> IEnumerable<T>.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- public Enumerator GetEnumerator ()
- {
- return new Enumerator (this);
- }
-
- // returns true if the value was inserted, false if the value already existed in the tree
- public bool Insert (T value)
- {
- RBTree.Node n = new Node (value);
- return tree.Intern (value, n) == n;
- }
-
- // returns true if the value was removed, false if the value didn't exist in the tree
- public bool Remove (T value)
- {
- return tree.Remove (value) != null;
- }
-
- public bool Contains (T value)
- {
- return tree.Lookup (value) != null;
- }
-
- public T this [int index] {
- get { return ((Node) tree [index]).value; }
- }
-
- public int Count {
- get { return (int) tree.Count; }
- }
-
- public void VerifyInvariants ()
- {
- tree.VerifyInvariants ();
- }
-
- public void Dump ()
- {
- tree.Dump ();
- }
- }
-
- class Test {
- static void Main (string [] args)
- {
- Random r = new Random ();
- Dictionary<int, int> d = new Dictionary<int, int> ();
- TreeSet<int> t = new TreeSet<int> ();
- int iters = args.Length == 0 ? 100000 : Int32.Parse (args [0]);
- int watermark = 1;
-
- for (int i = 0; i < iters; ++i) {
- if (i >= watermark) {
- watermark += 1 + watermark/4;
- t.VerifyInvariants ();
- }
-
- int n = r.Next ();
- if (d.ContainsKey (n))
- continue;
- d [n] = n;
-
- try {
- if (t.Contains (n))
- throw new Exception ("tree says it has a number it shouldn't");
- if (!t.Insert (n))
- throw new Exception ("tree says it has a number it shouldn't");
- } catch {
- Console.Error.WriteLine ("Exception while inserting {0} in iteration {1}", n, i);
- throw;
- }
- }
- t.VerifyInvariants ();
- if (d.Count != t.Count)
- throw new Exception ("tree count is wrong?");
-
- Console.WriteLine ("Tree has {0} elements", t.Count);
-
- foreach (int n in d.Keys)
- if (!t.Contains (n))
- throw new Exception ("tree says it doesn't have a number it should");
-
- Dictionary<int, int> d1 = new Dictionary<int, int> (d);
-
- int prev = -1;
- foreach (int n in t) {
- if (n < prev)
- throw new Exception ("iteration out of order");
- if (!d1.Remove (n))
- throw new Exception ("tree has a number it shouldn't");
- prev = n;
- }
-
- if (d1.Count != 0)
- throw new Exception ("tree has numbers it shouldn't");
-
- for (int i = 0; i < iters; ++i) {
- int n = r.Next ();
- if (!d.ContainsKey (n)) {
- if (t.Contains (n))
- throw new Exception ("tree says it doesn't have a number it should");
- } else if (!t.Contains (n)) {
- throw new Exception ("tree says it has a number it shouldn't");
- }
- }
-
- int count = t.Count;
- foreach (int n in d.Keys) {
- if (count <= watermark) {
- watermark -= watermark/4;
- t.VerifyInvariants ();
- }
- try {
- if (!t.Remove (n))
- throw new Exception ("tree says it doesn't have a number it should");
- --count;
- if (t.Count != count)
- throw new Exception ("Remove didn't remove exactly one element");
- } catch {
- Console.Error.WriteLine ("While trying to remove {0} from tree of size {1}", n, t.Count);
- t.Dump ();
- t.VerifyInvariants ();
- throw;
- }
- if (t.Contains (n))
- throw new Exception ("tree says it has a number it shouldn't");
- }
- t.VerifyInvariants ();
-
- if (t.Count != 0)
- throw new Exception ("tree claims to have elements");
- }
- }
-}
-#endif
-
+++ /dev/null
-//
-// System.Collections.Generic.SortedDictionary
-//
-// Author:
-// Raja R Harinath <rharinath@novell.com>
-//
-// Authors of previous (superseded) version:
-// Kazuki Oikawa (kazuki@panicode.com)
-// Atsushi Enomoto (atsushi@ximian.com)
-//
-
-//
-// Copyright (C) 2007, Novell, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Diagnostics;
-using System.Runtime.Serialization;
-using System.Security.Permissions;
-
-namespace System.Collections.Generic
-{
- [Serializable]
- [DebuggerDisplay ("Count={Count}")]
- [DebuggerTypeProxy (typeof (CollectionDebuggerView<,>))]
- public class SortedDictionary<TKey,TValue> : IDictionary<TKey,TValue>, ICollection<KeyValuePair<TKey,TValue>>, IEnumerable<KeyValuePair<TKey,TValue>>, IDictionary, ICollection, IEnumerable, ISerializable
- {
- class Node : RBTree.Node {
- public TKey key;
- public TValue value;
-
- public Node (TKey key)
- {
- this.key = key;
- }
-
- public Node (TKey key, TValue value)
- {
- this.key = key;
- this.value = value;
- }
-
- public override void SwapValue (RBTree.Node other)
- {
- Node o = (Node) other;
- TKey k = key; key = o.key; o.key = k;
- TValue v = value; value = o.value; o.value = v;
- }
-
- public KeyValuePair<TKey, TValue> AsKV ()
- {
- return new KeyValuePair<TKey, TValue> (key, value);
- }
-
- public DictionaryEntry AsDE ()
- {
- return new DictionaryEntry (key, value);
- }
- }
-
- [Serializable]
- class NodeHelper : RBTree.INodeHelper<TKey> {
- public IComparer<TKey> cmp;
-
- public int Compare (TKey key, RBTree.Node node)
- {
- return cmp.Compare (key, ((Node) node).key);
- }
-
- public RBTree.Node CreateNode (TKey key)
- {
- return new Node (key);
- }
-
- private NodeHelper (IComparer<TKey> cmp)
- {
- this.cmp = cmp;
- }
- static NodeHelper Default = new NodeHelper (Comparer<TKey>.Default);
- public static NodeHelper GetHelper (IComparer<TKey> cmp)
- {
- if (cmp == null || cmp == Comparer<TKey>.Default)
- return Default;
- return new NodeHelper (cmp);
- }
- }
-
- RBTree tree;
- NodeHelper hlp;
-
- #region Constructor
- public SortedDictionary () : this ((IComparer<TKey>) null)
- {
- }
-
- public SortedDictionary (IComparer<TKey> comparer)
- {
- hlp = NodeHelper.GetHelper (comparer);
- tree = new RBTree (hlp);
- }
-
- public SortedDictionary (IDictionary<TKey,TValue> dictionary) : this (dictionary, null)
- {
- }
-
- public SortedDictionary (IDictionary<TKey,TValue> dictionary, IComparer<TKey> comparer) : this (comparer)
- {
- if (dictionary == null)
- throw new ArgumentNullException ("dictionary");
-
- foreach (KeyValuePair<TKey, TValue> entry in dictionary)
- Add (entry.Key, entry.Value);
- }
-
- protected SortedDictionary (SerializationInfo info, StreamingContext context)
- {
- hlp = (NodeHelper)info.GetValue("Helper", typeof(NodeHelper));
- tree = new RBTree (hlp);
-
- KeyValuePair<TKey, TValue> [] data = (KeyValuePair<TKey, TValue>[])info.GetValue("KeyValuePairs", typeof(KeyValuePair<TKey, TValue>[]));
- foreach (KeyValuePair<TKey, TValue> entry in data)
- Add(entry.Key, entry.Value);
- }
-
- #endregion
-
- #region PublicProperty
-
- public IComparer<TKey> Comparer {
- get { return hlp.cmp; }
- }
-
- public int Count {
- get { return (int) tree.Count; }
- }
-
- public TValue this [TKey key] {
- get {
- Node n = (Node) tree.Lookup (key);
- if (n == null)
- throw new KeyNotFoundException ();
- return n.value;
- }
- set {
- if (key == null)
- throw new ArgumentNullException ("key");
- Node n = (Node) tree.Intern (key, null);
- n.value = value;
- }
- }
-
- public KeyCollection Keys {
- get { return new KeyCollection (this); }
- }
-
- public ValueCollection Values {
- get { return new ValueCollection (this); }
- }
- #endregion
-
- #region PublicMethod
-
- public void Add (TKey key, TValue value)
- {
- if (key == null)
- throw new ArgumentNullException ("key");
-
- RBTree.Node n = new Node (key, value);
- if (tree.Intern (key, n) != n)
- throw new ArgumentException ("key already present in dictionary", "key");
- }
-
- public void Clear ()
- {
- tree.Clear ();
- }
-
- public bool ContainsKey (TKey key)
- {
- return tree.Lookup (key) != null;
- }
-
- public bool ContainsValue (TValue value)
- {
- IEqualityComparer<TValue> vcmp = EqualityComparer<TValue>.Default;
- foreach (Node n in tree)
- if (vcmp.Equals (value, n.value))
- return true;
- return false;
- }
-
- public void CopyTo (KeyValuePair<TKey,TValue>[] array, int index)
- {
- if (Count == 0)
- return;
- if (array == null)
- throw new ArgumentNullException ();
- if (index < 0 || array.Length <= index)
- throw new ArgumentOutOfRangeException ();
- if (array.Length - index < Count)
- throw new ArgumentException ();
-
- foreach (Node n in tree)
- array [index ++] = n.AsKV ();
- }
-
- public Enumerator GetEnumerator ()
- {
- return new Enumerator (this);
- }
-
- public bool Remove (TKey key)
- {
- return tree.Remove (key) != null;
- }
-
- public bool TryGetValue (TKey key, out TValue value)
- {
- Node n = (Node) tree.Lookup (key);
- value = n == null ? default (TValue) : n.value;
- return n != null;
- }
-
- [SecurityPermission (SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.SerializationFormatter)]
- public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException ("info");
-
- KeyValuePair<TKey, TValue> [] data = new KeyValuePair<TKey,TValue> [Count];
- CopyTo (data, 0);
- info.AddValue ("KeyValuePairs", data);
- info.AddValue ("Helper", hlp);
- }
-
- #endregion
-
- #region PrivateMethod
- TKey ToKey (object key)
- {
- if (key == null)
- throw new ArgumentNullException ("key");
- if (!(key is TKey))
- throw new ArgumentException (String.Format ("Key \"{0}\" cannot be converted to the key type {1}.", key, typeof (TKey)));
- return (TKey) key;
- }
-
- TValue ToValue (object value)
- {
- if (!(value is TValue) && (value != null || typeof (TValue).IsValueType))
- throw new ArgumentException (String.Format ("Value \"{0}\" cannot be converted to the value type {1}.", value, typeof (TValue)));
- return (TValue) value;
- }
- #endregion
-
- #region IDictionary<TKey,TValue> Member
-
- ICollection<TKey> IDictionary<TKey,TValue>.Keys {
- get { return new KeyCollection (this); }
- }
-
- ICollection<TValue> IDictionary<TKey,TValue>.Values {
- get { return new ValueCollection (this); }
- }
-
- #endregion
-
- #region ICollection<KeyValuePair<TKey,TValue>> Member
-
- void ICollection<KeyValuePair<TKey,TValue>>.Add (KeyValuePair<TKey,TValue> item)
- {
- Add (item.Key, item.Value);
- }
-
- bool ICollection<KeyValuePair<TKey,TValue>>.Contains (KeyValuePair<TKey,TValue> item)
- {
- TValue value;
- return TryGetValue (item.Key, out value) &&
- EqualityComparer<TValue>.Default.Equals (item.Value, value);
- }
-
- bool ICollection<KeyValuePair<TKey,TValue>>.IsReadOnly {
- get { return false; }
- }
-
- bool ICollection<KeyValuePair<TKey,TValue>>.Remove (KeyValuePair<TKey,TValue> item)
- {
- TValue value;
- return TryGetValue (item.Key, out value) &&
- EqualityComparer<TValue>.Default.Equals (item.Value, value) &&
- Remove (item.Key);
- }
-
- #endregion
-
- #region IDictionary Member
-
- void IDictionary.Add (object key, object value)
- {
- Add (ToKey (key), ToValue (value));
- }
-
- bool IDictionary.Contains (object key)
- {
- return ContainsKey (ToKey (key));
- }
-
- IDictionaryEnumerator IDictionary.GetEnumerator ()
- {
- return new Enumerator (this);
- }
-
- bool IDictionary.IsFixedSize {
- get { return false; }
- }
-
- bool IDictionary.IsReadOnly {
- get { return false; }
- }
-
- ICollection IDictionary.Keys {
- get { return new KeyCollection (this); }
- }
-
- void IDictionary.Remove (object key)
- {
- Remove (ToKey (key));
- }
-
- ICollection IDictionary.Values {
- get { return new ValueCollection (this); }
- }
-
- object IDictionary.this [object key] {
- get { return this [ToKey (key)]; }
- set { this [ToKey (key)] = ToValue (value); }
- }
-
- #endregion
-
- #region ICollection Member
-
- void ICollection.CopyTo (Array array, int index)
- {
- if (Count == 0)
- return;
- if (array == null)
- throw new ArgumentNullException ();
- if (index < 0 || array.Length <= index)
- throw new ArgumentOutOfRangeException ();
- if (array.Length - index < Count)
- throw new ArgumentException ();
-
- foreach (Node n in tree)
- array.SetValue (n.AsDE (), index++);
- }
-
- bool ICollection.IsSynchronized {
- get { return false; }
- }
-
- // TODO:Is this correct? If this is wrong,please fix.
- object ICollection.SyncRoot {
- get { return this; }
- }
-
- #endregion
-
- #region IEnumerable Member
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return new Enumerator (this);
- }
-
- #endregion
-
- #region IEnumerable<TKey> Member
-
- IEnumerator<KeyValuePair<TKey,TValue>> IEnumerable<KeyValuePair<TKey,TValue>>.GetEnumerator ()
- {
- return new Enumerator (this);
- }
-
- #endregion
-
- [Serializable]
- [DebuggerDisplay ("Count={Count}")]
- [DebuggerTypeProxy (typeof (CollectionDebuggerView<,>))]
- public sealed class ValueCollection : ICollection<TValue>,
- IEnumerable<TValue>, ICollection, IEnumerable
- {
- SortedDictionary<TKey,TValue> _dic;
-
- public ValueCollection (SortedDictionary<TKey,TValue> dictionary)
- {
- if (dictionary == null)
- throw new ArgumentNullException ("dictionary");
-
- _dic = dictionary;
- }
-
- void ICollection<TValue>.Add (TValue item)
- {
- throw new NotSupportedException ();
- }
-
- void ICollection<TValue>.Clear ()
- {
- throw new NotSupportedException ();
- }
-
- bool ICollection<TValue>.Contains (TValue item)
- {
- return _dic.ContainsValue (item);
- }
-
- public void CopyTo (TValue [] array, int index)
- {
- if (Count == 0)
- return;
- if (array == null)
- throw new ArgumentNullException ();
- if (index < 0 || array.Length <= index)
- throw new ArgumentOutOfRangeException ();
- if (array.Length - index < Count)
- throw new ArgumentException ();
- foreach (Node n in _dic.tree)
- array [index++] = n.value;
- }
-
- public int Count {
- get { return _dic.Count; }
- }
-
- bool ICollection<TValue>.IsReadOnly {
- get { return true; }
- }
-
- bool ICollection<TValue>.Remove (TValue item)
- {
- throw new NotSupportedException ();
- }
-
- IEnumerator<TValue> IEnumerable<TValue>.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- public Enumerator GetEnumerator ()
- {
- return new Enumerator (_dic);
- }
-
- void ICollection.CopyTo (Array array, int index)
- {
- if (Count == 0)
- return;
- if (array == null)
- throw new ArgumentNullException ();
- if (index < 0 || array.Length <= index)
- throw new ArgumentOutOfRangeException ();
- if (array.Length - index < Count)
- throw new ArgumentException ();
- foreach (Node n in _dic.tree)
- array.SetValue (n.value, index++);
- }
-
- bool ICollection.IsSynchronized {
- get { return false; }
- }
-
- object ICollection.SyncRoot {
- get { return _dic; }
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return new Enumerator (_dic);
- }
-
- public struct Enumerator : IEnumerator<TValue>,IEnumerator, IDisposable
- {
- RBTree.NodeEnumerator host;
-
- TValue current;
-
- internal Enumerator (SortedDictionary<TKey,TValue> dictionary)
- : this ()
- {
- host = dictionary.tree.GetEnumerator ();
- }
-
- public TValue Current {
- get { return current; }
- }
-
- public bool MoveNext ()
- {
- if (!host.MoveNext ())
- return false;
- current = ((Node) host.Current).value;
- return true;
- }
-
- public void Dispose ()
- {
- host.Dispose ();
- }
-
- object IEnumerator.Current {
- get {
- host.check_current ();
- return current;
- }
- }
-
- void IEnumerator.Reset ()
- {
- host.Reset ();
- }
- }
- }
-
- [Serializable]
- [DebuggerDisplay ("Count={Count}")]
- [DebuggerTypeProxy (typeof (CollectionDebuggerView<,>))]
- public sealed class KeyCollection : ICollection<TKey>,
- IEnumerable<TKey>, ICollection, IEnumerable
- {
- SortedDictionary<TKey,TValue> _dic;
-
- public KeyCollection (SortedDictionary<TKey,TValue> dictionary)
- {
- _dic = dictionary;
- }
-
- void ICollection<TKey>.Add (TKey item)
- {
- throw new NotSupportedException ();
- }
-
- void ICollection<TKey>.Clear ()
- {
- throw new NotSupportedException ();
- }
-
- bool ICollection<TKey>.Contains (TKey item)
- {
- return _dic.ContainsKey (item);
- }
-
- IEnumerator<TKey> IEnumerable<TKey>.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- public void CopyTo (TKey [] array, int index)
- {
- if (Count == 0)
- return;
- if (array == null)
- throw new ArgumentNullException ();
- if (index < 0 || array.Length <= index)
- throw new ArgumentOutOfRangeException ();
- if (array.Length - index < Count)
- throw new ArgumentException ();
- foreach (Node n in _dic.tree)
- array [index++] = n.key;
- }
-
- public int Count {
- get { return _dic.Count; }
- }
-
- bool ICollection<TKey>.IsReadOnly {
- get { return true; }
- }
-
- bool ICollection<TKey>.Remove (TKey item)
- {
- throw new NotSupportedException ();
- }
-
- public Enumerator GetEnumerator ()
- {
- return new Enumerator (_dic);
- }
-
- void ICollection.CopyTo (Array array, int index)
- {
- if (Count == 0)
- return;
- if (array == null)
- throw new ArgumentNullException ();
- if (index < 0 || array.Length <= index)
- throw new ArgumentOutOfRangeException ();
- if (array.Length - index < Count)
- throw new ArgumentException ();
- foreach (Node n in _dic.tree)
- array.SetValue (n.key, index++);
- }
-
- bool ICollection.IsSynchronized {
- get { return false; }
- }
-
- object ICollection.SyncRoot {
- get { return _dic; }
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return new Enumerator (_dic);
- }
-
- public struct Enumerator : IEnumerator<TKey>, IEnumerator, IDisposable
- {
- RBTree.NodeEnumerator host;
-
- TKey current;
-
- internal Enumerator (SortedDictionary<TKey,TValue> dic)
- : this ()
- {
- host = dic.tree.GetEnumerator ();
- }
-
- public TKey Current {
- get { return current; }
- }
-
- public bool MoveNext ()
- {
- if (!host.MoveNext ())
- return false;
- current = ((Node) host.Current).key;
- return true;
- }
-
- public void Dispose ()
- {
- host.Dispose ();
- }
-
- object IEnumerator.Current {
- get {
- host.check_current ();
- return current;
- }
- }
-
- void IEnumerator.Reset ()
- {
- host.Reset ();
- }
- }
- }
-
- public struct Enumerator : IEnumerator<KeyValuePair<TKey,TValue>>, IDisposable, IDictionaryEnumerator, IEnumerator
- {
- RBTree.NodeEnumerator host;
-
- KeyValuePair<TKey, TValue> current;
-
- internal Enumerator (SortedDictionary<TKey,TValue> dic)
- : this ()
- {
- host = dic.tree.GetEnumerator ();
- }
-
- public KeyValuePair<TKey,TValue> Current {
- get { return current; }
- }
-
- public bool MoveNext ()
- {
- if (!host.MoveNext ())
- return false;
- current = ((Node) host.Current).AsKV ();
- return true;
- }
-
- public void Dispose ()
- {
- host.Dispose ();
- }
-
- Node CurrentNode {
- get {
- host.check_current ();
- return (Node) host.Current;
- }
- }
-
- DictionaryEntry IDictionaryEnumerator.Entry {
- get { return CurrentNode.AsDE (); }
- }
-
- object IDictionaryEnumerator.Key {
- get { return CurrentNode.key; }
- }
-
- object IDictionaryEnumerator.Value {
- get { return CurrentNode.value; }
- }
-
- object IEnumerator.Current {
- get { return CurrentNode.AsDE (); }
- }
-
- void IEnumerator.Reset ()
- {
- host.Reset ();
- }
- }
- }
-}
+++ /dev/null
-//
-// System.Collections.Generic.SortedList.cs
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-// Duncan Mak (duncan@ximian.com)
-// Herve Poussineau (hpoussineau@fr.st
-// Zoltan Varga (vargaz@gmail.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Globalization;
-using System.Runtime.InteropServices;
-using System.Diagnostics;
-
-namespace System.Collections.Generic
-{
- /// <summary>
- /// Represents a collection of associated keys and values
- /// that are sorted by the keys and are accessible by key
- /// and by index.
- /// </summary>
- [Serializable]
- [ComVisible(false)]
- [DebuggerDisplay ("Count={Count}")]
- [DebuggerTypeProxy (typeof (CollectionDebuggerView<,>))]
- public class SortedList<TKey, TValue> : IDictionary<TKey, TValue>,
- IDictionary,
- ICollection,
- ICollection<KeyValuePair<TKey, TValue>>,
- IEnumerable<KeyValuePair<TKey, TValue>>,
- IEnumerable {
-
- private readonly static int INITIAL_SIZE = 16;
-
- private enum EnumeratorMode : int { KEY_MODE = 0, VALUE_MODE, ENTRY_MODE }
-
- private int inUse;
- private int modificationCount;
- private KeyValuePair<TKey, TValue>[] table;
- private IComparer<TKey> comparer;
- private int defaultCapacity;
-
- //
- // Constructors
- //
- public SortedList ()
- : this (INITIAL_SIZE, null)
- {
- }
-
- public SortedList (int capacity)
- : this (capacity, null)
- {
- }
-
- public SortedList (int capacity, IComparer<TKey> comparer)
- {
- if (capacity < 0)
- throw new ArgumentOutOfRangeException ("initialCapacity");
-
- if (capacity == 0)
- defaultCapacity = 0;
- else
- defaultCapacity = INITIAL_SIZE;
- Init (comparer, capacity, true);
- }
-
- public SortedList (IComparer<TKey> comparer) : this (INITIAL_SIZE, comparer)
- {
- }
-
- public SortedList (IDictionary<TKey, TValue> dictionary) : this (dictionary, null)
- {
- }
-
- public SortedList (IDictionary<TKey, TValue> dictionary, IComparer<TKey> comparer)
- {
- if (dictionary == null)
- throw new ArgumentNullException ("dictionary");
-
- Init (comparer, dictionary.Count, true);
-
- foreach (KeyValuePair<TKey, TValue> kvp in dictionary)
- Add (kvp.Key, kvp.Value);
- }
-
- //
- // Properties
- //
-
- // ICollection
-
- public int Count {
- get {
- return inUse;
- }
- }
-
- bool ICollection.IsSynchronized {
- get {
- return false;
- }
- }
-
- Object ICollection.SyncRoot {
- get {
- return this;
- }
- }
-
- // IDictionary
-
- bool IDictionary.IsFixedSize {
- get {
- return false;
- }
- }
-
- bool IDictionary.IsReadOnly {
- get {
- return false;
- }
- }
-
- public TValue this [TKey key] {
- get {
- if (key == null)
- throw new ArgumentNullException("key");
-
- int i = Find (key);
-
- if (i >= 0)
- return table [i].Value;
- else
- throw new KeyNotFoundException ();
- }
- set {
- if (key == null)
- throw new ArgumentNullException("key");
-
- PutImpl (key, value, true);
- }
- }
-
- object IDictionary.this [object key] {
- get {
- TValue obj;
- if (key is TKey && TryGetValue ((TKey)key, out obj))
- return obj;
- return null;
- }
-
- set {
- this [ToKey (key)] = ToValue (value);
- }
- }
-
- public int Capacity {
- get {
- return table.Length;
- }
-
- set {
- int current = this.table.Length;
-
- if (inUse > value) {
- throw new ArgumentOutOfRangeException("capacity too small");
- }
- else if (value == 0) {
- // return to default size
- KeyValuePair<TKey, TValue> [] newTable = new KeyValuePair<TKey, TValue> [defaultCapacity];
- Array.Copy (table, newTable, inUse);
- this.table = newTable;
- }
- else if (value > inUse) {
- KeyValuePair<TKey, TValue> [] newTable = new KeyValuePair<TKey, TValue> [value];
- Array.Copy (table, newTable, inUse);
- this.table = newTable;
- }
- else if (value > current) {
- KeyValuePair<TKey, TValue> [] newTable = new KeyValuePair<TKey, TValue> [value];
- Array.Copy (table, newTable, current);
- this.table = newTable;
- }
- }
- }
-
- public IList<TKey> Keys {
- get {
- return new ListKeys (this);
- }
- }
-
- public IList<TValue> Values {
- get {
- return new ListValues (this);
- }
- }
-
- ICollection IDictionary.Keys {
- get {
- return new ListKeys (this);
- }
- }
-
- ICollection IDictionary.Values {
- get {
- return new ListValues (this);
- }
- }
-
- ICollection<TKey> IDictionary<TKey, TValue>.Keys {
- get {
- return Keys;
- }
- }
-
- ICollection<TValue> IDictionary<TKey, TValue>.Values {
- get {
- return Values;
- }
- }
-
- public IComparer<TKey> Comparer {
- get {
- return comparer;
- }
- }
-
- bool ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly {
- get {
- return false;
- }
- }
-
- //
- // Public instance methods.
- //
-
- public void Add (TKey key, TValue value)
- {
- if (key == null)
- throw new ArgumentNullException ("key");
-
- PutImpl (key, value, false);
- }
-
- public bool ContainsKey (TKey key)
- {
- if (key == null)
- throw new ArgumentNullException ("key");
-
- return (Find (key) >= 0);
- }
-
- public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator ()
- {
- for (int i = 0; i < inUse; i ++) {
- KeyValuePair<TKey, TValue> current = this.table [i];
-
- yield return new KeyValuePair<TKey, TValue> (current.Key, current.Value);
- }
- }
-
- public bool Remove (TKey key)
- {
- if (key == null)
- throw new ArgumentNullException ("key");
-
- int i = IndexOfKey (key);
- if (i >= 0) {
- RemoveAt (i);
- return true;
- }
- else
- return false;
- }
-
- // ICollection<KeyValuePair<TKey, TValue>>
-
- void ICollection<KeyValuePair<TKey, TValue>>.Clear ()
- {
- Clear ();
- }
-
- public void Clear ()
- {
- Array.Clear (table, 0, table.Length);
- inUse = 0;
- modificationCount++;
- }
-
- void ICollection<KeyValuePair<TKey, TValue>>.CopyTo (KeyValuePair<TKey, TValue>[] array, int arrayIndex)
- {
- if (Count == 0)
- return;
-
- if (null == array)
- throw new ArgumentNullException();
-
- if (arrayIndex < 0)
- throw new ArgumentOutOfRangeException();
-
- if (arrayIndex >= array.Length)
- throw new ArgumentNullException("arrayIndex is greater than or equal to array.Length");
- if (Count > (array.Length - arrayIndex))
- throw new ArgumentNullException("Not enough space in array from arrayIndex to end of array");
-
- int i = arrayIndex;
- foreach (KeyValuePair<TKey, TValue> pair in this)
- array [i++] = pair;
- }
-
- void ICollection<KeyValuePair<TKey, TValue>>.Add (KeyValuePair<TKey, TValue> keyValuePair) {
- Add (keyValuePair.Key, keyValuePair.Value);
- }
-
- bool ICollection<KeyValuePair<TKey, TValue>>.Contains (KeyValuePair<TKey, TValue> keyValuePair) {
- int i = Find (keyValuePair.Key);
-
- if (i >= 0)
- return Comparer<KeyValuePair<TKey, TValue>>.Default.Compare (table [i], keyValuePair) == 0;
- else
- return false;
- }
-
- bool ICollection<KeyValuePair<TKey, TValue>>.Remove (KeyValuePair<TKey, TValue> keyValuePair) {
- int i = Find (keyValuePair.Key);
-
- if (i >= 0 && (Comparer<KeyValuePair<TKey, TValue>>.Default.Compare (table [i], keyValuePair) == 0)) {
- RemoveAt (i);
- return true;
- }
- else
- return false;
- }
-
- // IEnumerable<KeyValuePair<TKey, TValue>>
-
- IEnumerator<KeyValuePair<TKey, TValue>> IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator ()
- {
- for (int i = 0; i < inUse; i ++) {
- KeyValuePair<TKey, TValue> current = this.table [i];
-
- yield return new KeyValuePair<TKey, TValue> (current.Key, current.Value);
- }
- }
-
- // IEnumerable
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- // IDictionary
-
- void IDictionary.Add (object key, object value)
- {
- PutImpl (ToKey (key), ToValue (value), false);
- }
-
- bool IDictionary.Contains (object key)
- {
- if (null == key)
- throw new ArgumentNullException();
- if (!(key is TKey))
- return false;
-
- return (Find ((TKey)key) >= 0);
- }
-
- IDictionaryEnumerator IDictionary.GetEnumerator ()
- {
- return new Enumerator (this, EnumeratorMode.ENTRY_MODE);
- }
-
- void IDictionary.Remove (object key)
- {
- if (null == key)
- throw new ArgumentNullException ("key");
- if (!(key is TKey))
- return;
- int i = IndexOfKey ((TKey)key);
- if (i >= 0) RemoveAt (i);
- }
-
- // ICollection
-
- void ICollection.CopyTo (Array array, int arrayIndex)
- {
- if (Count == 0)
- return;
-
- if (null == array)
- throw new ArgumentNullException();
-
- if (arrayIndex < 0)
- throw new ArgumentOutOfRangeException();
-
- if (array.Rank > 1)
- throw new ArgumentException("array is multi-dimensional");
- if (arrayIndex >= array.Length)
- throw new ArgumentNullException("arrayIndex is greater than or equal to array.Length");
- if (Count > (array.Length - arrayIndex))
- throw new ArgumentNullException("Not enough space in array from arrayIndex to end of array");
-
- IEnumerator<KeyValuePair<TKey,TValue>> it = GetEnumerator ();
- int i = arrayIndex;
-
- while (it.MoveNext ()) {
- array.SetValue (it.Current, i++);
- }
- }
-
- //
- // SortedList<TKey, TValue>
- //
-
- public void RemoveAt (int index)
- {
- KeyValuePair<TKey, TValue> [] table = this.table;
- int cnt = Count;
- if (index >= 0 && index < cnt) {
- if (index != cnt - 1) {
- Array.Copy (table, index+1, table, index, cnt-1-index);
- } else {
- table [index] = default (KeyValuePair <TKey, TValue>);
- }
- --inUse;
- ++modificationCount;
- } else {
- throw new ArgumentOutOfRangeException("index out of range");
- }
- }
-
- public int IndexOfKey (TKey key)
- {
- if (key == null)
- throw new ArgumentNullException ("key");
-
- int indx = Find (key);
-
- return (indx | (indx >> 31));
- }
-
- public int IndexOfValue (TValue value)
- {
- if (inUse == 0)
- return -1;
-
- for (int i = 0; i < inUse; i ++) {
- KeyValuePair<TKey, TValue> current = this.table [i];
-
- if (Equals (value, current.Value))
- return i;
- }
-
- return -1;
- }
-
- public bool ContainsValue (TValue value)
- {
- return IndexOfValue (value) >= 0;
- }
-
- public void TrimExcess ()
- {
- if (inUse < table.Length * 0.9)
- Capacity = inUse;
- }
-
- public bool TryGetValue (TKey key, out TValue value)
- {
- if (key == null)
- throw new ArgumentNullException("key");
-
- int i = Find (key);
-
- if (i >= 0) {
- value = table [i].Value;
- return true;
- }
- else {
- value = default (TValue);
- return false;
- }
- }
-
- //
- // Private methods
- //
-
- private void EnsureCapacity (int n, int free)
- {
- KeyValuePair<TKey, TValue> [] table = this.table;
- KeyValuePair<TKey, TValue> [] newTable = null;
- int cap = Capacity;
- bool gap = (free >=0 && free < Count);
-
- if (n > cap) {
- newTable = new KeyValuePair<TKey, TValue> [n << 1];
- }
-
- if (newTable != null) {
- if (gap) {
- int copyLen = free;
- if (copyLen > 0) {
- Array.Copy (table, 0, newTable, 0, copyLen);
- }
- copyLen = Count - free;
- if (copyLen > 0) {
- Array.Copy (table, free, newTable, free+1, copyLen);
- }
- } else {
- // Just a resizing, copy the entire table.
- Array.Copy (table, newTable, Count);
- }
- this.table = newTable;
- } else if (gap) {
- Array.Copy (table, free, table, free+1, Count - free);
- }
- }
-
- private void PutImpl (TKey key, TValue value, bool overwrite)
- {
- if (key == null)
- throw new ArgumentNullException ("null key");
-
- KeyValuePair<TKey, TValue> [] table = this.table;
-
- int freeIndx = Find (key);
-
- if (freeIndx >= 0) {
- if (!overwrite)
- throw new ArgumentException("element already exists");
-
- table [freeIndx] = new KeyValuePair <TKey, TValue> (key, value);
- ++modificationCount;
- return;
- }
-
- freeIndx = ~freeIndx;
-
- if (freeIndx > Capacity + 1)
- throw new Exception ("SortedList::internal error ("+key+", "+value+") at ["+freeIndx+"]");
-
-
- EnsureCapacity (Count+1, freeIndx);
-
- table = this.table;
- table [freeIndx] = new KeyValuePair <TKey, TValue> (key, value);
-
- ++inUse;
- ++modificationCount;
-
- }
-
- private void Init (IComparer<TKey> comparer, int capacity, bool forceSize)
- {
- if (comparer == null)
- comparer = Comparer<TKey>.Default;
- this.comparer = comparer;
- if (!forceSize && (capacity < defaultCapacity))
- capacity = defaultCapacity;
- this.table = new KeyValuePair<TKey, TValue> [capacity];
- this.inUse = 0;
- this.modificationCount = 0;
- }
-
- private void CopyToArray (Array arr, int i,
- EnumeratorMode mode)
- {
- if (arr == null)
- throw new ArgumentNullException ("arr");
-
- if (i < 0 || i + this.Count > arr.Length)
- throw new ArgumentOutOfRangeException ("i");
-
- IEnumerator it = new Enumerator (this, mode);
-
- while (it.MoveNext ()) {
- arr.SetValue (it.Current, i++);
- }
- }
-
- private int Compare (TKey a, TKey b)
- {
- try {
- return comparer.Compare (a, b);
- } catch (Exception ex) {
- throw new InvalidOperationException ("Failed to compare two elements.", ex);
- }
- }
-
- private int Find (TKey key)
- {
- KeyValuePair<TKey, TValue> [] table = this.table;
- int len = Count;
-
- if (len == 0) return ~0;
-
- int left = 0;
- int right = len-1;
-
- while (left <= right) {
- int guess = left + ((right - left) >> 1);
-
- int cmp = Compare (table[guess].Key, key);
- if (cmp == 0) return guess;
-
- if (cmp < 0) left = guess+1;
- else right = guess-1;
- }
-
- return ~left;
- }
-
- private TKey ToKey (object key) {
- if (key == null)
- throw new ArgumentNullException ("key");
- if (!(key is TKey))
- throw new ArgumentException ("The value \"" + key + "\" isn't of type \"" + typeof (TKey) + "\" and can't be used in this generic collection.", "key");
- return (TKey)key;
- }
-
- private TValue ToValue (object value) {
- if (!(value is TValue))
- throw new ArgumentException ("The value \"" + value + "\" isn't of type \"" + typeof (TValue) + "\" and can't be used in this generic collection.", "value");
- return (TValue)value;
- }
-
- internal TKey KeyAt (int index) {
- if (index >= 0 && index < Count)
- return table [index].Key;
- else
- throw new ArgumentOutOfRangeException("Index out of range");
- }
-
- internal TValue ValueAt (int index) {
- if (index >= 0 && index < Count)
- return table [index].Value;
- else
- throw new ArgumentOutOfRangeException("Index out of range");
- }
-
- //
- // Inner classes
- //
-
-
- private sealed class Enumerator : ICloneable, IDictionaryEnumerator, IEnumerator {
-
- private SortedList<TKey, TValue>host;
- private int stamp;
- private int pos;
- private int size;
- private EnumeratorMode mode;
-
- private object currentKey;
- private object currentValue;
-
- bool invalid = false;
-
- private readonly static string xstr = "SortedList.Enumerator: snapshot out of sync.";
-
- public Enumerator (SortedList<TKey, TValue>host, EnumeratorMode mode)
- {
- this.host = host;
- stamp = host.modificationCount;
- size = host.Count;
- this.mode = mode;
- Reset ();
- }
-
- public Enumerator (SortedList<TKey, TValue>host)
- : this (host, EnumeratorMode.ENTRY_MODE)
- {
- }
-
- public void Reset ()
- {
- if (host.modificationCount != stamp || invalid)
- throw new InvalidOperationException (xstr);
-
- pos = -1;
- currentKey = null;
- currentValue = null;
- }
-
- public bool MoveNext ()
- {
- if (host.modificationCount != stamp || invalid)
- throw new InvalidOperationException (xstr);
-
- KeyValuePair<TKey, TValue> [] table = host.table;
-
- if (++pos < size) {
- KeyValuePair<TKey, TValue> entry = table [pos];
-
- currentKey = entry.Key;
- currentValue = entry.Value;
- return true;
- }
-
- currentKey = null;
- currentValue = null;
- return false;
- }
-
- public DictionaryEntry Entry
- {
- get {
- if (invalid || pos >= size || pos == -1)
- throw new InvalidOperationException (xstr);
-
- return new DictionaryEntry (currentKey,
- currentValue);
- }
- }
-
- public Object Key {
- get {
- if (invalid || pos >= size || pos == -1)
- throw new InvalidOperationException (xstr);
- return currentKey;
- }
- }
-
- public Object Value {
- get {
- if (invalid || pos >= size || pos == -1)
- throw new InvalidOperationException (xstr);
- return currentValue;
- }
- }
-
- public Object Current {
- get {
- if (invalid || pos >= size || pos == -1)
- throw new InvalidOperationException (xstr);
-
- switch (mode) {
- case EnumeratorMode.KEY_MODE:
- return currentKey;
- case EnumeratorMode.VALUE_MODE:
- return currentValue;
- case EnumeratorMode.ENTRY_MODE:
- return this.Entry;
-
- default:
- throw new NotSupportedException (mode + " is not a supported mode.");
- }
- }
- }
-
- // ICloneable
-
- public object Clone ()
- {
- Enumerator e = new Enumerator (host, mode);
- e.stamp = stamp;
- e.pos = pos;
- e.size = size;
- e.currentKey = currentKey;
- e.currentValue = currentValue;
- e.invalid = invalid;
- return e;
- }
- }
-
- [Serializable]
- struct KeyEnumerator : IEnumerator <TKey>, IDisposable {
- const int NOT_STARTED = -2;
-
- // this MUST be -1, because we depend on it in move next.
- // we just decr the size, so, 0 - 1 == FINISHED
- const int FINISHED = -1;
-
- SortedList <TKey, TValue> l;
- int idx;
- int ver;
-
- internal KeyEnumerator (SortedList<TKey, TValue> l)
- {
- this.l = l;
- idx = NOT_STARTED;
- ver = l.modificationCount;
- }
-
- public void Dispose ()
- {
- idx = NOT_STARTED;
- }
-
- public bool MoveNext ()
- {
- if (ver != l.modificationCount)
- throw new InvalidOperationException ("Collection was modified after the enumerator was instantiated.");
-
- if (idx == NOT_STARTED)
- idx = l.Count;
-
- return idx != FINISHED && -- idx != FINISHED;
- }
-
- public TKey Current {
- get {
- if (idx < 0)
- throw new InvalidOperationException ();
-
- return l.KeyAt (l.Count - 1 - idx);
- }
- }
-
- void IEnumerator.Reset ()
- {
- if (ver != l.modificationCount)
- throw new InvalidOperationException ("Collection was modified after the enumerator was instantiated.");
-
- idx = NOT_STARTED;
- }
-
- object IEnumerator.Current {
- get { return Current; }
- }
- }
-
- [Serializable]
- struct ValueEnumerator : IEnumerator <TValue>, IDisposable {
- const int NOT_STARTED = -2;
-
- // this MUST be -1, because we depend on it in move next.
- // we just decr the size, so, 0 - 1 == FINISHED
- const int FINISHED = -1;
-
- SortedList <TKey, TValue> l;
- int idx;
- int ver;
-
- internal ValueEnumerator (SortedList<TKey, TValue> l)
- {
- this.l = l;
- idx = NOT_STARTED;
- ver = l.modificationCount;
- }
-
- public void Dispose ()
- {
- idx = NOT_STARTED;
- }
-
- public bool MoveNext ()
- {
- if (ver != l.modificationCount)
- throw new InvalidOperationException ("Collection was modified after the enumerator was instantiated.");
-
- if (idx == NOT_STARTED)
- idx = l.Count;
-
- return idx != FINISHED && -- idx != FINISHED;
- }
-
- public TValue Current {
- get {
- if (idx < 0)
- throw new InvalidOperationException ();
-
- return l.ValueAt (l.Count - 1 - idx);
- }
- }
-
- void IEnumerator.Reset ()
- {
- if (ver != l.modificationCount)
- throw new InvalidOperationException ("Collection was modified after the enumerator was instantiated.");
-
- idx = NOT_STARTED;
- }
-
- object IEnumerator.Current {
- get { return Current; }
- }
- }
-
- private class ListKeys : IList<TKey>, ICollection, IEnumerable {
-
- private SortedList<TKey, TValue> host;
-
- public ListKeys (SortedList<TKey, TValue> host)
- {
- if (host == null)
- throw new ArgumentNullException ();
-
- this.host = host;
- }
-
- // ICollection<TKey>
-
- public virtual void Add (TKey item) {
- throw new NotSupportedException();
- }
-
- public virtual bool Remove (TKey key) {
- throw new NotSupportedException ();
- }
-
- public virtual void Clear () {
- throw new NotSupportedException();
- }
-
- public virtual void CopyTo (TKey[] array, int arrayIndex) {
- if (host.Count == 0)
- return;
- if (array == null)
- throw new ArgumentNullException ("array");
- if (arrayIndex < 0)
- throw new ArgumentOutOfRangeException();
- if (arrayIndex >= array.Length)
- throw new ArgumentOutOfRangeException ("arrayIndex is greater than or equal to array.Length");
- if (Count > (array.Length - arrayIndex))
- throw new ArgumentOutOfRangeException("Not enough space in array from arrayIndex to end of array");
-
- int j = arrayIndex;
- for (int i = 0; i < Count; ++i)
- array [j ++] = host.KeyAt (i);
- }
-
- public virtual bool Contains (TKey item) {
- return host.IndexOfKey (item) > -1;
- }
-
- //
- // IList<TKey>
- //
- public virtual int IndexOf (TKey item) {
- return host.IndexOfKey (item);
- }
-
- public virtual void Insert (int index, TKey item) {
- throw new NotSupportedException ();
- }
-
- public virtual void RemoveAt (int index) {
- throw new NotSupportedException ();
- }
-
- public virtual TKey this [int index] {
- get {
- return host.KeyAt (index);
- }
- set {
- throw new NotSupportedException("attempt to modify a key");
- }
- }
-
- //
- // IEnumerable<TKey>
- //
-
- public virtual IEnumerator<TKey> GetEnumerator ()
- {
- /* We couldn't use yield as it does not support Reset () */
- return new KeyEnumerator (host);
- }
-
- //
- // ICollection
- //
-
- public virtual int Count {
- get {
- return host.Count;
- }
- }
-
- public virtual bool IsSynchronized {
- get {
- return ((ICollection)host).IsSynchronized;
- }
- }
-
- public virtual bool IsReadOnly {
- get {
- return true;
- }
- }
-
- public virtual Object SyncRoot {
- get {
- return ((ICollection)host).SyncRoot;
- }
- }
-
- public virtual void CopyTo (Array array, int arrayIndex)
- {
- host.CopyToArray (array, arrayIndex, EnumeratorMode.KEY_MODE);
- }
-
- //
- // IEnumerable
- //
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- for (int i = 0; i < host.Count; ++i)
- yield return host.KeyAt (i);
- }
- }
-
- private class ListValues : IList<TValue>, ICollection, IEnumerable {
-
- private SortedList<TKey, TValue>host;
-
- public ListValues (SortedList<TKey, TValue>host)
- {
- if (host == null)
- throw new ArgumentNullException ();
-
- this.host = host;
- }
-
- // ICollection<TValue>
-
- public virtual void Add (TValue item) {
- throw new NotSupportedException();
- }
-
- public virtual bool Remove (TValue value) {
- throw new NotSupportedException ();
- }
-
- public virtual void Clear () {
- throw new NotSupportedException();
- }
-
- public virtual void CopyTo (TValue[] array, int arrayIndex) {
- if (host.Count == 0)
- return;
- if (array == null)
- throw new ArgumentNullException ("array");
- if (arrayIndex < 0)
- throw new ArgumentOutOfRangeException();
- if (arrayIndex >= array.Length)
- throw new ArgumentOutOfRangeException ("arrayIndex is greater than or equal to array.Length");
- if (Count > (array.Length - arrayIndex))
- throw new ArgumentOutOfRangeException("Not enough space in array from arrayIndex to end of array");
-
- int j = arrayIndex;
- for (int i = 0; i < Count; ++i)
- array [j ++] = host.ValueAt (i);
- }
-
- public virtual bool Contains (TValue item) {
- return host.IndexOfValue (item) > -1;
- }
-
- //
- // IList<TValue>
- //
- public virtual int IndexOf (TValue item) {
- return host.IndexOfValue (item);
- }
-
- public virtual void Insert (int index, TValue item) {
- throw new NotSupportedException ();
- }
-
- public virtual void RemoveAt (int index) {
- throw new NotSupportedException ();
- }
-
- public virtual TValue this [int index] {
- get {
- return host.ValueAt (index);
- }
- set {
- throw new NotSupportedException("attempt to modify a key");
- }
- }
-
- //
- // IEnumerable<TValue>
- //
-
- public virtual IEnumerator<TValue> GetEnumerator ()
- {
- /* We couldn't use yield as it does not support Reset () */
- return new ValueEnumerator (host);
- }
-
- //
- // ICollection
- //
-
- public virtual int Count {
- get {
- return host.Count;
- }
- }
-
- public virtual bool IsSynchronized {
- get {
- return ((ICollection)host).IsSynchronized;
- }
- }
-
- public virtual bool IsReadOnly {
- get {
- return true;
- }
- }
-
- public virtual Object SyncRoot {
- get {
- return ((ICollection)host).SyncRoot;
- }
- }
-
- public virtual void CopyTo (Array array, int arrayIndex)
- {
- host.CopyToArray (array, arrayIndex, EnumeratorMode.VALUE_MODE);
- }
-
- //
- // IEnumerable
- //
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- for (int i = 0; i < host.Count; ++i)
- yield return host.ValueAt (i);
- }
- }
-
- } // SortedList
-
-} // System.Collections.Generic
+++ /dev/null
-//
-// SortedSet.cs
-//
-// Authors:
-// Jb Evain <jbevain@novell.com>
-// Marek Safar (marek.safar@gmail.com)
-//
-// Copyright (C) 2010 Novell, Inc (http://www.novell.com)
-// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-using System.Security;
-using System.Security.Permissions;
-using System.Diagnostics;
-
-// SortedSet is basically implemented as a reduction of SortedDictionary<K, V>
-
-#if NET_4_0
-
-namespace System.Collections.Generic {
-
- [Serializable]
- [DebuggerDisplay ("Count={Count}")]
- [DebuggerTypeProxy (typeof (CollectionDebuggerView))]
- public class SortedSet<T> : ISet<T>, ICollection, ISerializable, IDeserializationCallback
- {
- class Node : RBTree.Node {
-
- public T item;
-
- public Node (T item)
- {
- this.item = item;
- }
-
- public override void SwapValue (RBTree.Node other)
- {
- var o = (Node) other;
- var i = this.item;
- this.item = o.item;
- o.item = i;
- }
- }
-
- class NodeHelper : RBTree.INodeHelper<T> {
-
- static NodeHelper Default = new NodeHelper (Comparer<T>.Default);
-
- public IComparer<T> comparer;
-
- public int Compare (T item, RBTree.Node node)
- {
- return comparer.Compare (item, ((Node) node).item);
- }
-
- public RBTree.Node CreateNode (T item)
- {
- return new Node (item);
- }
-
- NodeHelper (IComparer<T> comparer)
- {
- this.comparer = comparer;
- }
-
- public static NodeHelper GetHelper (IComparer<T> comparer)
- {
- if (comparer == null || comparer == Comparer<T>.Default)
- return Default;
-
- return new NodeHelper (comparer);
- }
- }
-
- RBTree tree;
- NodeHelper helper;
- SerializationInfo si;
-
- public SortedSet ()
- : this (Comparer<T>.Default)
- {
- }
-
- public SortedSet (IEnumerable<T> collection)
- : this (collection, Comparer<T>.Default)
- {
- }
-
- public SortedSet (IEnumerable<T> collection, IComparer<T> comparer)
- : this (comparer)
- {
- if (collection == null)
- throw new ArgumentNullException ("collection");
-
- foreach (var item in collection)
- Add (item);
- }
-
- public SortedSet (IComparer<T> comparer)
- {
- this.helper = NodeHelper.GetHelper (comparer);
- this.tree = new RBTree (this.helper);
- }
-
- protected SortedSet (SerializationInfo info, StreamingContext context)
- {
- this.si = info;
- }
-
- public IComparer<T> Comparer {
- get { return helper.comparer; }
- }
-
- public int Count {
- get { return GetCount (); }
- }
-
- public T Max {
- get { return GetMax (); }
- }
-
- public T Min {
- get { return GetMin (); }
- }
-
- internal virtual T GetMax ()
- {
- if (tree.Count == 0)
- return default (T);
-
- return GetItem (tree.Count - 1);
- }
-
- internal virtual T GetMin ()
- {
- if (tree.Count == 0)
- return default (T);
-
- return GetItem (0);
- }
-
- internal virtual int GetCount ()
- {
- return tree.Count;
- }
-
- T GetItem (int index)
- {
- return ((Node) tree [index]).item;
- }
-
- public bool Add (T item)
- {
- return TryAdd (item);
- }
-
- internal virtual bool TryAdd (T item)
- {
- var node = new Node (item);
- return tree.Intern (item, node) == node;
- }
-
- public virtual void Clear ()
- {
- tree.Clear ();
- }
-
- public virtual bool Contains (T item)
- {
- return tree.Lookup (item) != null;
- }
-
- public void CopyTo (T [] array)
- {
- CopyTo (array, 0, Count);
- }
-
- public void CopyTo (T [] array, int index)
- {
- CopyTo (array, index, Count);
- }
-
- public void CopyTo (T [] array, int index, int count)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
- if (index < 0)
- throw new ArgumentOutOfRangeException ("index");
- if (index > array.Length)
- throw new ArgumentException ("index larger than largest valid index of array");
- if (array.Length - index < count)
- throw new ArgumentException ("destination array cannot hold the requested elements");
-
- foreach (Node node in tree) {
- if (count-- == 0)
- break;
-
- array [index++] = node.item;
- }
- }
-
- public bool Remove (T item)
- {
- return TryRemove (item);
- }
-
- internal virtual bool TryRemove (T item)
- {
- return tree.Remove (item) != null;
- }
-
- public int RemoveWhere (Predicate<T> match)
- {
- var array = ToArray ();
-
- int count = 0;
- foreach (var item in array) {
- if (!match (item))
- continue;
-
- Remove (item);
- count++;
- }
-
- return count;
- }
-
- public IEnumerable<T> Reverse ()
- {
- for (int i = tree.Count - 1; i >= 0; i--)
- yield return GetItem (i);
- }
-
- T [] ToArray ()
- {
- var array = new T [this.Count];
- CopyTo (array);
- return array;
- }
-
- public Enumerator GetEnumerator ()
- {
- return TryGetEnumerator ();
- }
-
- internal virtual Enumerator TryGetEnumerator ()
- {
- return new Enumerator (this);
- }
-
- IEnumerator<T> IEnumerable<T>.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- public static IEqualityComparer<SortedSet<T>> CreateSetComparer ()
- {
- return CreateSetComparer (EqualityComparer<T>.Default);
- }
-
- [MonoTODO]
- public static IEqualityComparer<SortedSet<T>> CreateSetComparer (IEqualityComparer<T> memberEqualityComparer)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- throw new NotImplementedException ();
- }
-
- void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
- {
- GetObjectData (info, context);
- }
-
- [MonoTODO]
- protected virtual void OnDeserialization (object sender)
- {
- if (si == null)
- return;
-
- throw new NotImplementedException ();
- }
-
- void IDeserializationCallback.OnDeserialization (object sender)
- {
- OnDeserialization (sender);
- }
-
- [MonoLimitation ("Isn't O(n) when other is SortedSet<T>")]
- public void ExceptWith (IEnumerable<T> other)
- {
- if (other == this) {
- Clear ();
- return;
- }
-
- CheckArgumentNotNull (other, "other");
- foreach (T item in other)
- Remove (item);
- }
-
- public virtual SortedSet<T> GetViewBetween (T lowerValue, T upperValue)
- {
- if (Comparer.Compare (lowerValue, upperValue) > 0)
- throw new ArgumentException ("The lowerValue is bigger than upperValue");
-
- return new SortedSubSet (this, lowerValue, upperValue);
- }
-
- [MonoLimitation ("Isn't O(n) when other is SortedSet<T>")]
- public virtual void IntersectWith (IEnumerable<T> other)
- {
- CheckArgumentNotNull (other, "other");
-
- RBTree newtree = new RBTree (helper);
- foreach (T item in other) {
- var node = tree.Remove (item);
- if (node != null)
- newtree.Intern (item, node);
- }
- tree = newtree;
- }
-
- public bool IsProperSubsetOf (IEnumerable<T> other)
- {
- CheckArgumentNotNull (other, "other");
-
- if (Count == 0) {
- foreach (T item in other)
- return true; // this idiom means: if 'other' is non-empty, return true
- return false;
- }
-
- return is_subset_of (other, true);
- }
-
- public bool IsProperSupersetOf (IEnumerable<T> other)
- {
- CheckArgumentNotNull (other, "other");
-
- if (Count == 0)
- return false;
-
- return is_superset_of (other, true);
- }
-
- public bool IsSubsetOf (IEnumerable<T> other)
- {
- CheckArgumentNotNull (other, "other");
-
- if (Count == 0)
- return true;
-
- return is_subset_of (other, false);
- }
-
- public bool IsSupersetOf (IEnumerable<T> other)
- {
- CheckArgumentNotNull (other, "other");
-
- if (Count == 0) {
- foreach (T item in other)
- return false; // this idiom means: if 'other' is non-empty, return false
- return true;
- }
-
- return is_superset_of (other, false);
- }
-
- // Precondition: Count != 0, other != null
- bool is_subset_of (IEnumerable<T> other, bool proper)
- {
- SortedSet<T> that = nodups (other);
-
- if (Count > that.Count)
- return false;
- // Count != 0 && Count <= that.Count => that.Count != 0
- if (proper && Count == that.Count)
- return false;
- return that.covers (this);
- }
-
- // Precondition: Count != 0, other != null
- bool is_superset_of (IEnumerable<T> other, bool proper)
- {
- SortedSet<T> that = nodups (other);
-
- if (that.Count == 0)
- return true;
- if (Count < that.Count)
- return false;
- if (proper && Count == that.Count)
- return false;
- return this.covers (that);
- }
-
- public bool Overlaps (IEnumerable<T> other)
- {
- CheckArgumentNotNull (other, "other");
-
- if (Count == 0)
- return false;
-
- // Don't use 'nodups' here. Only optimize the SortedSet<T> case
- SortedSet<T> that = other as SortedSet<T>;
- if (that != null && that.Comparer != Comparer)
- that = null;
-
- if (that != null)
- return that.Count != 0 && overlaps (that);
-
- foreach (T item in other)
- if (Contains (item))
- return true;
- return false;
- }
-
- public bool SetEquals (IEnumerable<T> other)
- {
- CheckArgumentNotNull (other, "other");
-
- if (Count == 0) {
- foreach (T item in other)
- return false;
- return true;
- }
-
- SortedSet<T> that = nodups (other);
-
- if (Count != that.Count)
- return false;
-
- using (var t = that.GetEnumerator ()) {
- foreach (T item in this) {
- if (!t.MoveNext ())
- throw new SystemException ("count wrong somewhere: this longer than that");
- if (Comparer.Compare (item, t.Current) != 0)
- return false;
- }
- if (t.MoveNext ())
- throw new SystemException ("count wrong somewhere: this shorter than that");
- return true;
- }
- }
-
- SortedSet<T> nodups (IEnumerable<T> other)
- {
- SortedSet<T> that = other as SortedSet<T>;
- if (that != null && that.Comparer == Comparer)
- return that;
- return new SortedSet<T> (other, Comparer);
- }
-
- bool covers (SortedSet<T> that)
- {
- using (var t = that.GetEnumerator ()) {
- if (!t.MoveNext ())
- return true;
- foreach (T item in this) {
- int cmp = Comparer.Compare (item, t.Current);
- if (cmp > 0)
- return false;
- if (cmp == 0 && !t.MoveNext ())
- return true;
- }
- return false;
- }
- }
-
- bool overlaps (SortedSet<T> that)
- {
- using (var t = that.GetEnumerator ()) {
- if (!t.MoveNext ())
- return false;
- foreach (T item in this) {
- int cmp;
- while ((cmp = Comparer.Compare (item, t.Current)) > 0) {
- if (!t.MoveNext ())
- return false;
- }
- if (cmp == 0)
- return true;
- }
- return false;
- }
- }
-
- [MonoLimitation ("Isn't O(n) when other is SortedSet<T>")]
- public void SymmetricExceptWith (IEnumerable<T> other)
- {
- if (other == this) {
- Clear ();
- return;
- }
-
- SortedSet<T> that_minus_this = new SortedSet<T> (Comparer);
-
- // compute this - that and that - this in parallel
- foreach (T item in nodups (other))
- if (!Remove (item))
- that_minus_this.Add (item);
-
- UnionWith (that_minus_this);
- }
-
- [MonoLimitation ("Isn't O(n) when other is SortedSet<T>")]
- public void UnionWith (IEnumerable<T> other)
- {
- CheckArgumentNotNull (other, "other");
-
- foreach (T item in other)
- Add (item);
- }
-
- static void CheckArgumentNotNull (object arg, string name)
- {
- if (arg == null)
- throw new ArgumentNullException (name);
- }
-
- void ICollection<T>.Add (T item)
- {
- Add (item);
- }
-
- bool ICollection<T>.IsReadOnly {
- get { return false; }
- }
-
- void ICollection.CopyTo (Array array, int index)
- {
- if (Count == 0)
- return;
- if (array == null)
- throw new ArgumentNullException ("array");
- if (index < 0 || array.Length <= index)
- throw new ArgumentOutOfRangeException ("index");
- if (array.Length - index < Count)
- throw new ArgumentException ();
-
- foreach (Node node in tree)
- array.SetValue (node.item, index++);
- }
-
- bool ICollection.IsSynchronized {
- get { return false; }
- }
-
- // TODO:Is this correct? If this is wrong,please fix.
- object ICollection.SyncRoot {
- get { return this; }
- }
-
- [Serializable]
- public struct Enumerator : IEnumerator<T>, IDisposable {
-
- RBTree.NodeEnumerator host;
-
- IComparer<T> comparer;
-
- T current;
- T upper;
-
- internal Enumerator (SortedSet<T> set)
- : this ()
- {
- host = set.tree.GetEnumerator ();
- }
-
- internal Enumerator (SortedSet<T> set, T lower, T upper)
- : this ()
- {
- host = set.tree.GetSuffixEnumerator (lower);
- comparer = set.Comparer;
- this.upper = upper;
- }
-
- public T Current {
- get { return current; }
- }
-
- object IEnumerator.Current {
- get {
- host.check_current ();
- return ((Node) host.Current).item;
- }
- }
-
- public bool MoveNext ()
- {
- if (!host.MoveNext ())
- return false;
-
- current = ((Node) host.Current).item;
- return comparer == null || comparer.Compare (upper, current) >= 0;
- }
-
- public void Dispose ()
- {
- host.Dispose ();
- }
-
- void IEnumerator.Reset ()
- {
- host.Reset ();
- }
- }
-
- [Serializable]
- sealed class SortedSubSet : SortedSet<T>, IEnumerable<T>, IEnumerable {
-
- SortedSet<T> set;
- T lower;
- T upper;
-
- public SortedSubSet (SortedSet<T> set, T lower, T upper)
- : base (set.Comparer)
- {
- this.set = set;
- this.lower = lower;
- this.upper = upper;
-
- }
-
- internal override T GetMin ()
- {
- RBTree.Node lb = null, ub = null;
- set.tree.Bound (lower, ref lb, ref ub);
-
- if (ub == null || set.helper.Compare (upper, ub) < 0)
- return default (T);
-
- return ((Node) ub).item;
- }
-
- internal override T GetMax ()
- {
- RBTree.Node lb = null, ub = null;
- set.tree.Bound (upper, ref lb, ref ub);
-
- if (lb == null || set.helper.Compare (lower, lb) > 0)
- return default (T);
-
- return ((Node) lb).item;
- }
-
- internal override int GetCount ()
- {
- int count = 0;
- using (var e = set.tree.GetSuffixEnumerator (lower)) {
- while (e.MoveNext () && set.helper.Compare (upper, e.Current) >= 0)
- ++count;
- }
- return count;
- }
-
- internal override bool TryAdd (T item)
- {
- if (!InRange (item))
- throw new ArgumentOutOfRangeException ("item");
-
- return set.TryAdd (item);
- }
-
- internal override bool TryRemove (T item)
- {
- if (!InRange (item))
- return false;
-
- return set.TryRemove (item);
- }
-
- public override bool Contains (T item)
- {
- if (!InRange (item))
- return false;
-
- return set.Contains (item);
- }
-
- public override void Clear ()
- {
- set.RemoveWhere (InRange);
- }
-
- bool InRange (T item)
- {
- return Comparer.Compare (item, lower) >= 0
- && Comparer.Compare (item, upper) <= 0;
- }
-
- public override SortedSet<T> GetViewBetween (T lowerValue, T upperValue)
- {
- if (Comparer.Compare (lowerValue, upperValue) > 0)
- throw new ArgumentException ("The lowerValue is bigger than upperValue");
- if (!InRange (lowerValue))
- throw new ArgumentOutOfRangeException ("lowerValue");
- if (!InRange (upperValue))
- throw new ArgumentOutOfRangeException ("upperValue");
-
- return new SortedSubSet (set, lowerValue, upperValue);
- }
-
- internal override Enumerator TryGetEnumerator ()
- {
- return new Enumerator (set, lower, upper);
- }
-
- public override void IntersectWith (IEnumerable<T> other)
- {
- CheckArgumentNotNull (other, "other");
-
- var slice = new SortedSet<T> (this);
- slice.IntersectWith (other);
-
- Clear ();
- set.UnionWith (slice);
- }
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Collections.Generic.Stack
-//
-// Authors:
-// Martin Baulig (martin@ximian.com)
-// Ben Maurer (bmaurer@ximian.com)
-//
-// (C) 2003, 2004 Novell, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-using System.Diagnostics;
-
-namespace System.Collections.Generic
-{
- [ComVisible (false)]
- [Serializable]
- [DebuggerDisplay ("Count={Count}")]
- [DebuggerTypeProxy (typeof (CollectionDebuggerView))]
- public class Stack <T> : IEnumerable <T>, ICollection, IEnumerable
- {
- T [] _array;
- int _size;
- int _version;
-
- private const int INITIAL_SIZE = 16;
-
- public Stack ()
- {
- }
-
- public Stack (int capacity)
- {
- if (capacity < 0)
- throw new ArgumentOutOfRangeException ("capacity");
-
- _array = new T [capacity];
- }
-
- public Stack (IEnumerable <T> collection)
- {
- if (collection == null)
- throw new ArgumentNullException ("collection");
-
- ICollection <T> col = collection as ICollection <T>;
-
- if (col != null) {
- _size = col.Count;
- _array = new T [_size];
- col.CopyTo (_array, 0);
- } else {
- foreach (T t in collection)
- Push (t);
- }
- }
-
- public void Clear ()
- {
- if (_array != null)
- Array.Clear (_array, 0, _array.Length);
-
- _size = 0;
- _version ++;
- }
-
- public bool Contains (T item)
- {
- return _array != null && Array.IndexOf (_array, item, 0, _size) != -1;
- }
-
- public void CopyTo (T [] array, int arrayIndex)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
- if (arrayIndex < 0)
- throw new ArgumentOutOfRangeException ("idx");
-
- // this gets copied in the order that it is poped
- if (_array != null) {
- Array.Copy (_array, 0, array, arrayIndex, _size);
- Array.Reverse (array, arrayIndex, _size);
- }
- }
-
- public T Peek ()
- {
- if (_size == 0)
- throw new InvalidOperationException ();
-
- return _array [_size - 1];
- }
-
- public T Pop ()
- {
- if (_size == 0)
- throw new InvalidOperationException ();
-
- _version ++;
- T popped = _array [--_size];
- // clear stuff out to make the GC happy
- _array [_size] = default(T);
- return popped;
- }
-
- public void Push (T item)
- {
- if (_array == null || _size == _array.Length)
- Array.Resize <T> (ref _array, _size == 0 ? INITIAL_SIZE : 2 * _size);
-
- _version ++;
-
- _array [_size++] = item;
- }
-
- public T [] ToArray ()
- {
- T [] copy = new T [_size];
- CopyTo (copy, 0);
- return copy;
- }
-
- public void TrimExcess ()
- {
- if (_array != null && (_size < _array.Length * 0.9))
- Array.Resize <T> (ref _array, _size);
- _version ++;
- }
-
- public int Count {
- get { return _size; }
- }
-
- bool ICollection.IsSynchronized {
- get { return false; }
- }
-
- object ICollection.SyncRoot {
- get { return this; }
- }
-
- void ICollection.CopyTo (Array dest, int idx)
- {
- try {
- if (_array != null) {
- Array.Copy (_array, 0, dest, idx, _size);
- Array.Reverse (dest, idx, _size);
- }
- } catch (ArrayTypeMismatchException) {
- throw new ArgumentException ();
- }
- }
-
- public Enumerator GetEnumerator ()
- {
- return new Enumerator (this);
- }
-
- IEnumerator <T> IEnumerable<T>.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- [Serializable]
- public struct Enumerator : IEnumerator <T>, IEnumerator, IDisposable {
- const int NOT_STARTED = -2;
-
- // this MUST be -1, because we depend on it in move next.
- // we just decr the _size, so, 0 - 1 == FINISHED
- const int FINISHED = -1;
-
- Stack <T> parent;
- int idx;
- int _version;
-
- internal Enumerator (Stack <T> t)
- {
- parent = t;
- idx = NOT_STARTED;
- _version = t._version;
- }
-
- // for some reason, MSFT added a dispose to this class
- // It means that in foreach, we must still do a try/finally. broken?
- public void Dispose ()
- {
- idx = FINISHED;
- }
-
- public bool MoveNext ()
- {
- if (_version != parent._version)
- throw new InvalidOperationException ();
-
- if (idx == -2)
- idx = parent._size;
-
- return idx != FINISHED && -- idx != FINISHED;
- }
-
- public T Current {
- get {
- if (idx < 0)
- throw new InvalidOperationException ();
-
- return parent._array [idx];
- }
- }
-
- void IEnumerator.Reset ()
- {
- if (_version != parent._version)
- throw new InvalidOperationException ();
-
- idx = NOT_STARTED;
- }
-
- object IEnumerator.Current {
- get { return Current; }
- }
-
- }
- }
-}
System.CodeDom.Compiler/TempFileCollection.cs
System.CodeDom/FieldDirection.cs
System.CodeDom/MemberAttributes.cs
-System.Collections.Generic/ISet.cs
-System.Collections.Generic/LinkedList.cs
-System.Collections.Generic/LinkedListNode.cs
-System.Collections.Generic/RBTree.cs
-System.Collections.Generic/Queue.cs
-System.Collections.Generic/SortedDictionary.cs
-System.Collections.Generic/SortedList.cs
-System.Collections.Generic/SortedSet.cs
-System.Collections.Generic/Stack.cs
System.Collections.ObjectModel/ObservableCollection.cs
System.Collections.ObjectModel/ReadOnlyObservableCollection.cs
System.Collections.Specialized/BitVector32.cs
../../../external/referencesource/System/sys/system/collections/concurrent/BlockingCollection.cs
../../../external/referencesource/System/sys/system/collections/concurrent/ConcurrentBag.cs
+../../../external/referencesource/System/compmod/system/collections/generic/bithelper.cs
+../../../external/referencesource/System/compmod/system/collections/generic/debugview.cs
+../../../external/referencesource/System/compmod/system/collections/generic/iset.cs
+../../../external/referencesource/System/compmod/system/collections/generic/linkedlist.cs
+../../../external/referencesource/System/compmod/system/collections/generic/queue.cs
+../../../external/referencesource/System/compmod/system/collections/generic/sorteddictionary.cs
+../../../external/referencesource/System/compmod/system/collections/generic/sortedlist.cs
+../../../external/referencesource/System/compmod/system/collections/generic/sortedset.cs
+../../../external/referencesource/System/compmod/system/collections/generic/sortedsetdebugview.cs
+../../../external/referencesource/System/compmod/system/collections/generic/stack.cs
+../../../external/referencesource/System/compmod/system/collections/generic/throwhelper.cs
}
[Test]
- [ExpectedException (typeof (ArgumentException))]
+ [ExpectedException (typeof (ArgumentNullException))]
public void IDictionaryAddValueNullValueType ()
{
IDictionary d = new SortedDictionary<string,int> ();
do_test (non_prime_odd_digit, digits, psb: true);
do_test_e (non_prime_odd_digit, new [] { 9 }, o: true, se: true);
do_test (non_trit, digits, psb: true);
- do_test (trit, non_trit);
+// do_test (trit, non_trit);
do_test_e (digits, trit.Concat (non_trit), o: true, se: true);
do_test_e (non_trit, new [] { 3, 4, 5, 6, 7, 8, 9 }, o: true, se: true);
do_test (digits.GetViewBetween (0, 2), trit, se: true);
+++ /dev/null
-../../build/common/Consts.cs
-../../build/common/Locale.cs
-../../build/common/MonoTODOAttribute.cs
-../corlib/System.Threading.Tasks/CyclicDeque.cs
-../corlib/System.Threading.Tasks/PopResult.cs
-../corlib/System.Threading.Tasks/IConcurrentDeque.cs
-../corlib/System.Threading/AtomicBoolean.cs
-../corlib/System.Collections/CollectionDebuggerView.cs
-../corlib/System.Collections.Generic/CollectionDebuggerView.cs
-../corlib/Mono/DataConverter.cs
-../corlib/System.IO/MonoIOError.cs
-../corlib/System.IO/MonoIO.cs
-../corlib/System.IO/MonoFileType.cs
-../corlib/System.IO/MonoIOStat.cs
-
-SR.cs
-../../build/common/SR.cs
-Assembly/AssemblyInfo.cs
-Microsoft.CSharp/CSharpCodeCompiler.cs
-Microsoft.CSharp/CSharpCodeGenerator.cs
-Microsoft.CSharp/CSharpCodeProvider.cs
-Microsoft.VisualBasic/VBCodeCompiler.cs
-Microsoft.VisualBasic/VBCodeGenerator.cs
-Microsoft.VisualBasic/VBCodeProvider.cs
-Microsoft.Win32/IntranetZoneCredentialPolicy.cs
-Microsoft.Win32/PowerModeChangedEventArgs.cs
-Microsoft.Win32/PowerModeChangedEventHandler.cs
-Microsoft.Win32/PowerModes.cs
-Microsoft.Win32/SessionEndedEventArgs.cs
-Microsoft.Win32/SessionEndedEventHandler.cs
-Microsoft.Win32/SessionEndingEventArgs.cs
-Microsoft.Win32/SessionEndingEventHandler.cs
-Microsoft.Win32/SessionEndReasons.cs
-Microsoft.Win32/SessionSwitchEventArgs.cs
-Microsoft.Win32/SessionSwitchEventHandler.cs
-Microsoft.Win32/SessionSwitchReason.cs
-Microsoft.Win32/SystemEvents.cs
-Microsoft.Win32/TimerElapsedEventArgs.cs
-Microsoft.Win32/TimerElapsedEventHandler.cs
-Microsoft.Win32/UserPreferenceCategory.cs
-Microsoft.Win32/UserPreferenceChangedEventArgs.cs
-Microsoft.Win32/UserPreferenceChangedEventHandler.cs
-Microsoft.Win32/UserPreferenceChangingEventArgs.cs
-Microsoft.Win32/UserPreferenceChangingEventHandler.cs
-Mono.Http/NtlmClient.cs
-System.CodeDom/CodeArgumentReferenceExpression.cs
-System.CodeDom/CodeArrayCreateExpression.cs
-System.CodeDom/CodeArrayIndexerExpression.cs
-System.CodeDom/CodeAssignStatement.cs
-System.CodeDom/CodeAttachEventStatement.cs
-System.CodeDom/CodeAttributeArgumentCollection.cs
-System.CodeDom/CodeAttributeArgument.cs
-System.CodeDom/CodeAttributeDeclarationCollection.cs
-System.CodeDom/CodeAttributeDeclaration.cs
-System.CodeDom/CodeBaseReferenceExpression.cs
-System.CodeDom/CodeBinaryOperatorExpression.cs
-System.CodeDom/CodeBinaryOperatorType.cs
-System.CodeDom/CodeCastExpression.cs
-System.CodeDom/CodeCatchClauseCollection.cs
-System.CodeDom/CodeCatchClause.cs
-System.CodeDom/CodeChecksumPragma.cs
-System.CodeDom/CodeComment.cs
-System.CodeDom/CodeCommentStatementCollection.cs
-System.CodeDom/CodeCommentStatement.cs
-System.CodeDom/CodeCompileUnit.cs
-System.CodeDom/CodeConditionStatement.cs
-System.CodeDom/CodeConstructor.cs
-System.CodeDom/CodeDefaultValueExpression.cs
-System.CodeDom/CodeDelegateCreateExpression.cs
-System.CodeDom/CodeDelegateInvokeExpression.cs
-System.CodeDom/CodeDirectionExpression.cs
-System.CodeDom/CodeDirectiveCollection.cs
-System.CodeDom/CodeDirective.cs
-System.CodeDom/CodeEntryPointMethod.cs
-System.CodeDom/CodeEventReferenceExpression.cs
-System.CodeDom/CodeExpressionCollection.cs
-System.CodeDom/CodeExpression.cs
-System.CodeDom/CodeExpressionStatement.cs
-System.CodeDom/CodeFieldReferenceExpression.cs
-System.CodeDom/CodeGotoStatement.cs
-System.CodeDom/CodeIndexerExpression.cs
-System.CodeDom/CodeIterationStatement.cs
-System.CodeDom/CodeLabeledStatement.cs
-System.CodeDom/CodeLinePragma.cs
-System.CodeDom/CodeMemberEvent.cs
-System.CodeDom/CodeMemberField.cs
-System.CodeDom/CodeMemberMethod.cs
-System.CodeDom/CodeMemberProperty.cs
-System.CodeDom/CodeMethodInvokeExpression.cs
-System.CodeDom/CodeMethodReferenceExpression.cs
-System.CodeDom/CodeMethodReturnStatement.cs
-System.CodeDom/CodeNamespaceCollection.cs
-System.CodeDom/CodeNamespace.cs
-System.CodeDom/CodeNamespaceImportCollection.cs
-System.CodeDom/CodeNamespaceImport.cs
-System.CodeDom/CodeObjectCreateExpression.cs
-System.CodeDom/CodeObject.cs
-System.CodeDom/CodeParameterDeclarationExpressionCollection.cs
-System.CodeDom/CodeParameterDeclarationExpression.cs
-System.CodeDom/CodePrimitiveExpression.cs
-System.CodeDom/CodePropertyReferenceExpression.cs
-System.CodeDom/CodePropertySetValueReferenceExpression.cs
-System.CodeDom/CodeRegionDirective.cs
-System.CodeDom/CodeRegionMode.cs
-System.CodeDom/CodeRemoveEventStatement.cs
-System.CodeDom/CodeSnippetCompileUnit.cs
-System.CodeDom/CodeSnippetExpression.cs
-System.CodeDom/CodeSnippetStatement.cs
-System.CodeDom/CodeSnippetTypeMember.cs
-System.CodeDom/CodeStatementCollection.cs
-System.CodeDom/CodeStatement.cs
-System.CodeDom/CodeThisReferenceExpression.cs
-System.CodeDom/CodeThrowExceptionStatement.cs
-System.CodeDom/CodeTryCatchFinallyStatement.cs
-System.CodeDom/CodeTypeConstructor.cs
-System.CodeDom/CodeTypeDeclarationCollection.cs
-System.CodeDom/CodeTypeDeclaration.cs
-System.CodeDom/CodeTypeDelegate.cs
-System.CodeDom/CodeTypeMemberCollection.cs
-System.CodeDom/CodeTypeMember.cs
-System.CodeDom/CodeTypeOfExpression.cs
-System.CodeDom/CodeTypeParameterCollection.cs
-System.CodeDom/CodeTypeParameter.cs
-System.CodeDom/CodeTypeReferenceCollection.cs
-System.CodeDom/CodeTypeReference.cs
-System.CodeDom/CodeTypeReferenceExpression.cs
-System.CodeDom/CodeTypeReferenceOptions.cs
-System.CodeDom/CodeVariableDeclarationStatement.cs
-System.CodeDom/CodeVariableReferenceExpression.cs
-System.CodeDom/ICodeDomVisitor.cs
-System.CodeDom.Compiler/CodeCompiler.cs
-System.CodeDom.Compiler/CodeDomConfigurationHandler.cs
-System.CodeDom.Compiler/CodeDomProvider.cs
-System.CodeDom.Compiler/CodeGenerator.cs
-System.CodeDom.Compiler/CodeGeneratorOptions.cs
-System.CodeDom.Compiler/CodeParser.cs
-System.CodeDom.Compiler/Compiler.cs
-System.CodeDom.Compiler/CompilerCollection.cs
-System.CodeDom.Compiler/CompilerErrorCollection.cs
-System.CodeDom.Compiler/CompilerError.cs
-System.CodeDom.Compiler/CompilerInfo.cs
-System.CodeDom.Compiler/CompilerParameters.cs
-System.CodeDom.Compiler/CompilerProviderOption.cs
-System.CodeDom.Compiler/CompilerProviderOptionsCollection.cs
-System.CodeDom.Compiler/CompilerResults.cs
-System.CodeDom.Compiler/Executor.cs
-System.CodeDom.Compiler/GeneratedCodeAttribute.cs
-System.CodeDom.Compiler/GeneratorSupport.cs
-System.CodeDom.Compiler/ICodeCompiler.cs
-System.CodeDom.Compiler/ICodeGenerator.cs
-System.CodeDom.Compiler/ICodeParser.cs
-System.CodeDom.Compiler/IndentedTextWriter.cs
-System.CodeDom.Compiler/LanguageOptions.cs
-System.CodeDom.Compiler/TempFileCollection.cs
-System.CodeDom/FieldDirection.cs
-System.CodeDom/MemberAttributes.cs
-System.Collections.Generic/ISet.cs
-System.Collections.Generic/LinkedList.cs
-System.Collections.Generic/LinkedListNode.cs
-System.Collections.Generic/RBTree.cs
-System.Collections.Generic/Queue.cs
-System.Collections.Generic/SortedDictionary.cs
-System.Collections.Generic/SortedList.cs
-System.Collections.Generic/SortedSet.cs
-System.Collections.Generic/Stack.cs
-System.Collections.Concurrent/BlockingCollection.cs
-System.Collections.Concurrent/ConcurrentBag.cs
-System.Collections.ObjectModel/ObservableCollection.cs
-System.Collections.ObjectModel/ReadOnlyObservableCollection.cs
-System.Collections.Specialized/BitVector32.cs
-System.Collections.Specialized/CollectionsUtil.cs
-System.Collections.Specialized/HybridDictionary.cs
-System.Collections.Specialized/IOrderedDictionary.cs
-System.Collections.Specialized/INotifyCollectionChanged.cs
-System.Collections.Specialized/ListDictionary.cs
-System.Collections.Specialized/NameObjectCollectionBase.cs
-System.Collections.Specialized/NameValueCollection.cs
-System.Collections.Specialized/NotifyCollectionChangedEventArgs.cs
-System.Collections.Specialized/NotifyCollectionChangedAction.cs
-System.Collections.Specialized/NotifyCollectionChangedEventHandler.cs
-System.Collections.Specialized/OrderedDictionary.cs
-System.Collections.Specialized/ProcessStringDictionary.cs
-System.Collections.Specialized/StringCollection.cs
-System.Collections.Specialized/StringDictionary.cs
-System.Collections.Specialized/StringEnumerator.cs
-System.ComponentModel/AddingNewEventArgs.cs
-System.ComponentModel/AddingNewEventHandler.cs
-System.ComponentModel/AmbientValueAttribute.cs
-System.ComponentModel/ArrayConverter.cs
-System.ComponentModel/AsyncCompletedEventArgs.cs
-System.ComponentModel/AsyncCompletedEventHandler.cs
-System.ComponentModel/AsyncOperation.cs
-System.ComponentModel/AsyncOperationManager.cs
-System.ComponentModel/AttributeProviderAttribute.cs
-System.ComponentModel/AttributeCollection.cs
-System.ComponentModel/BackgroundWorker.cs
-System.ComponentModel/BaseNumberConverter.cs
-System.ComponentModel/BindableAttribute.cs
-System.ComponentModel/BindableSupport.cs
-System.ComponentModel/BindingDirection.cs
-System.ComponentModel/BindingList.cs
-System.ComponentModel/BooleanConverter.cs
-System.ComponentModel/BrowsableAttribute.cs
-System.ComponentModel/ByteConverter.cs
-System.ComponentModel/CancelEventArgs.cs
-System.ComponentModel/CancelEventHandler.cs
-System.ComponentModel/CategoryAttribute.cs
-System.ComponentModel/CharConverter.cs
-System.ComponentModel/CollectionChangeAction.cs
-System.ComponentModel/CollectionChangeEventArgs.cs
-System.ComponentModel/CollectionChangeEventHandler.cs
-System.ComponentModel/CollectionConverter.cs
-System.ComponentModel/ComplexBindingPropertiesAttribute.cs
-System.ComponentModel/ComponentCollection.cs
-System.ComponentModel/ComponentConverter.cs
-System.ComponentModel/Component.cs
-System.ComponentModel/ComponentEditor.cs
-System.ComponentModel/ComponentResourceManager.cs
-System.ComponentModel/Container.cs
-System.ComponentModel/ContainerFilterService.cs
-System.ComponentModel/CultureInfoConverter.cs
-System.ComponentModel/CustomTypeDescriptor.cs
-System.ComponentModel/DataErrorsChangedEventArgs.cs
-System.ComponentModel/DataObjectAttribute.cs
-System.ComponentModel/DataObjectFieldAttribute.cs
-System.ComponentModel/DataObjectMethodAttribute.cs
-System.ComponentModel/DataObjectMethodType.cs
-System.ComponentModel/DateTimeConverter.cs
-System.ComponentModel/DateTimeOffsetConverter.cs
-System.ComponentModel/DecimalConverter.cs
-System.ComponentModel/DefaultBindingPropertyAttribute.cs
-System.ComponentModel/DefaultEventAttribute.cs
-System.ComponentModel/DefaultPropertyAttribute.cs
-System.ComponentModel/DefaultValueAttribute.cs
-System.ComponentModel/DerivedPropertyDescriptor.cs
-System.ComponentModel/DescriptionAttribute.cs
-System.ComponentModel.Design/ActiveDesignerEventArgs.cs
-System.ComponentModel.Design/ActiveDesignerEventHandler.cs
-System.ComponentModel.Design/CheckoutException.cs
-System.ComponentModel.Design/CommandID.cs
-System.ComponentModel.Design/ComponentChangedEventArgs.cs
-System.ComponentModel.Design/ComponentChangedEventHandler.cs
-System.ComponentModel.Design/ComponentChangingEventArgs.cs
-System.ComponentModel.Design/ComponentChangingEventHandler.cs
-System.ComponentModel.Design/ComponentEventArgs.cs
-System.ComponentModel.Design/ComponentEventHandler.cs
-System.ComponentModel.Design/ComponentRenameEventArgs.cs
-System.ComponentModel.Design/ComponentRenameEventHandler.cs
-System.ComponentModel.Design/DesignerCollection.cs
-System.ComponentModel.Design/DesignerOptionService.cs
-System.ComponentModel.Design/DesignerEventArgs.cs
-System.ComponentModel.Design/DesignerEventHandler.cs
-System.ComponentModel.Design/DesignerTransactionCloseEventArgs.cs
-System.ComponentModel.Design/DesignerTransactionCloseEventHandler.cs
-System.ComponentModel.Design/DesignerTransaction.cs
-System.ComponentModel.Design/DesignerVerbCollection.cs
-System.ComponentModel.Design/DesignerVerb.cs
-System.ComponentModel.Design/DesigntimeLicenseContext.cs
-System.ComponentModel.Design/DesigntimeLicenseContextSerializer.cs
-System.ComponentModel.Design/IDesignerHostTransactionState.cs
-System.ComponentModel.Design/TypeDescriptionProviderService.cs
-System.ComponentModel/DesignerAttribute.cs
-System.ComponentModel/DesignerCategoryAttribute.cs
-System.ComponentModel/DesignerSerializationVisibilityAttribute.cs
-System.ComponentModel/DesignerSerializationVisibility.cs
-System.ComponentModel.Design/HelpContextType.cs
-System.ComponentModel.Design/HelpKeywordAttribute.cs
-System.ComponentModel.Design/HelpKeywordType.cs
-System.ComponentModel.Design/IComponentChangeService.cs
-System.ComponentModel.Design/IComponentDiscoveryService.cs
-System.ComponentModel.Design/IComponentInitializer.cs
-System.ComponentModel.Design/IDesigner.cs
-System.ComponentModel.Design/IDesignerEventService.cs
-System.ComponentModel.Design/IDesignerFilter.cs
-System.ComponentModel.Design/IDesignerHost.cs
-System.ComponentModel.Design/IDesignerOptionService.cs
-System.ComponentModel.Design/IDictionaryService.cs
-System.ComponentModel.Design/IEventBindingService.cs
-System.ComponentModel.Design/IExtenderListService.cs
-System.ComponentModel.Design/IExtenderProviderService.cs
-System.ComponentModel.Design/IHelpService.cs
-System.ComponentModel.Design/IInheritanceService.cs
-System.ComponentModel.Design/IMenuCommandService.cs
-System.ComponentModel.Design/IReferenceService.cs
-System.ComponentModel.Design/IResourceService.cs
-System.ComponentModel.Design/IRootDesigner.cs
-System.ComponentModel.Design/ISelectionService.cs
-System.ComponentModel.Design/IServiceContainer.cs
-System.ComponentModel.Design/ITreeDesigner.cs
-System.ComponentModel.Design/ITypeDescriptorFilterService.cs
-System.ComponentModel.Design/ITypeDiscoveryService.cs
-System.ComponentModel.Design/ITypeResolutionService.cs
-System.ComponentModel.Design/MenuCommand.cs
-System.ComponentModel/DesignOnlyAttribute.cs
-System.ComponentModel.Design/RuntimeLicenseContext.cs
-System.ComponentModel.Design/SelectionTypes.cs
-System.ComponentModel.Design.Serialization/ComponentSerializationService.cs
-System.ComponentModel.Design.Serialization/ContextStack.cs
-System.ComponentModel.Design.Serialization/DesignerLoader.cs
-System.ComponentModel.Design.Serialization/DesignerSerializerAttribute.cs
-System.ComponentModel.Design.Serialization/IDesignerLoaderHost.cs
-System.ComponentModel.Design.Serialization/IDesignerLoaderHost2.cs
-System.ComponentModel.Design.Serialization/IDesignerLoaderService.cs
-System.ComponentModel.Design.Serialization/IDesignerSerializationManager.cs
-System.ComponentModel.Design.Serialization/IDesignerSerializationProvider.cs
-System.ComponentModel.Design.Serialization/IDesignerSerializationService.cs
-System.ComponentModel.Design.Serialization/INameCreationService.cs
-System.ComponentModel.Design.Serialization/InstanceDescriptor.cs
-System.ComponentModel.Design.Serialization/MemberRelationship.cs
-System.ComponentModel.Design.Serialization/MemberRelationshipService.cs
-System.ComponentModel.Design.Serialization/ResolveNameEventArgs.cs
-System.ComponentModel.Design.Serialization/ResolveNameEventHandler.cs
-System.ComponentModel.Design.Serialization/RootDesignerSerializerAttribute.cs
-System.ComponentModel.Design.Serialization/SerializationStore.cs
-System.ComponentModel.Design.Serialization/DefaultSerializationProviderAttribute.cs
-System.ComponentModel.Design/ServiceContainer.cs
-System.ComponentModel.Design/ServiceCreatorCallback.cs
-System.ComponentModel.Design/StandardCommands.cs
-System.ComponentModel.Design/StandardToolWindows.cs
-System.ComponentModel/DesignTimeVisibleAttribute.cs
-System.ComponentModel.Design/ViewTechnology.cs
-System.ComponentModel/DisplayNameAttribute.cs
-System.ComponentModel/DoubleConverter.cs
-System.ComponentModel/DoWorkEventHandler.cs
-System.ComponentModel/DoWorkEventArgs.cs
-System.ComponentModel/EditorAttribute.cs
-System.ComponentModel/EditorBrowsableAttribute.cs
-System.ComponentModel/EditorBrowsableState.cs
-System.ComponentModel/EnumConverter.cs
-System.ComponentModel/EventDescriptorCollection.cs
-System.ComponentModel/EventDescriptor.cs
-System.ComponentModel/EventHandlerList.cs
-System.ComponentModel/ExpandableObjectConverter.cs
-System.ComponentModel/ExtenderProvidedPropertyAttribute.cs
-System.ComponentModel/GuidConverter.cs
-System.ComponentModel/HandledEventArgs.cs
-System.ComponentModel/HandledEventHandler.cs
-System.ComponentModel/IBindingList.cs
-System.ComponentModel/IBindingListView.cs
-System.ComponentModel/ICancelAddNew.cs
-System.ComponentModel/IChangeTracking.cs
-System.ComponentModel/IComNativeDescriptorHandler.cs
-System.ComponentModel/IComponent.cs
-System.ComponentModel/IContainer.cs
-System.ComponentModel/ICustomTypeDescriptor.cs
-System.ComponentModel/IDataErrorInfo.cs
-System.ComponentModel/IEditableObject.cs
-System.ComponentModel/IExtenderProvider.cs
-System.ComponentModel/IIntellisenseBuilder.cs
-System.ComponentModel/IListSource.cs
-System.ComponentModel/ImmutableObjectAttribute.cs
-System.ComponentModel/INestedContainer.cs
-System.ComponentModel/INestedSite.cs
-System.ComponentModel/InheritanceAttribute.cs
-System.ComponentModel/InheritanceLevel.cs
-System.ComponentModel/InitializationEventAttribute.cs
-System.ComponentModel/INotifyDataErrorInfo.cs
-System.ComponentModel/INotifyPropertyChanged.cs
-System.ComponentModel/INotifyPropertyChanging.cs
-System.ComponentModel/InstallerTypeAttribute.cs
-System.ComponentModel/InstanceCreationEditor.cs
-System.ComponentModel/InvalidAsynchronousStateException.cs
-System.ComponentModel/Int16Converter.cs
-System.ComponentModel/Int32Converter.cs
-System.ComponentModel/Int64Converter.cs
-System.ComponentModel/InvalidEnumArgumentException.cs
-System.ComponentModel/IRevertibleChangeTracking.cs
-System.ComponentModel/IRaiseItemChangedEvents.cs
-System.ComponentModel/ISite.cs
-System.ComponentModel/ISupportInitialize.cs
-System.ComponentModel/ISupportInitializeNotification.cs
-System.ComponentModel/ISynchronizeInvoke.cs
-System.ComponentModel/ITypeDescriptorContext.cs
-System.ComponentModel/ITypedList.cs
-System.ComponentModel/LicenseContext.cs
-System.ComponentModel/License.cs
-System.ComponentModel/LicenseException.cs
-System.ComponentModel/LicenseManager.cs
-System.ComponentModel/LicenseProviderAttribute.cs
-System.ComponentModel/LicenseProvider.cs
-System.ComponentModel/LicenseUsageMode.cs
-System.ComponentModel/LicFileLicenseProvider.cs
-System.ComponentModel/ListBindableAttribute.cs
-System.ComponentModel/ListChangedEventArgs.cs
-System.ComponentModel/ListChangedEventHandler.cs
-System.ComponentModel/ListChangedType.cs
-System.ComponentModel/ListSortDescriptionCollection.cs
-System.ComponentModel/ListSortDescription.cs
-System.ComponentModel/ListSortDirection.cs
-System.ComponentModel/LocalizableAttribute.cs
-System.ComponentModel/LookupBindingPropertiesAttribute.cs
-System.ComponentModel/MarshalByValueComponent.cs
-System.ComponentModel/MaskedTextProvider.cs
-System.ComponentModel/MaskedTextResultHint.cs
-System.ComponentModel/MemberDescriptor.cs
-System.ComponentModel/MergablePropertyAttribute.cs
-System.ComponentModel/MultilineStringConverter.cs
-System.ComponentModel/NestedContainer.cs
-System.ComponentModel/NotifyParentPropertyAttribute.cs
-System.ComponentModel/NullableConverter.cs
-System.ComponentModel/ParenthesizePropertyNameAttribute.cs
-System.ComponentModel/PasswordPropertyTextAttribute.cs
-System.ComponentModel/PropertyChangedEventArgs.cs
-System.ComponentModel/PropertyChangedEventHandler.cs
-System.ComponentModel/PropertyChangingEventArgs.cs
-System.ComponentModel/PropertyChangingEventHandler.cs
-System.ComponentModel/PropertyDescriptorCollection.cs
-System.ComponentModel/PropertyDescriptor.cs
-System.ComponentModel/PropertyTabAttribute.cs
-System.ComponentModel/PropertyTabScope.cs
-System.ComponentModel/ProvidePropertyAttribute.cs
-System.ComponentModel/ReadOnlyAttribute.cs
-System.ComponentModel/RecommendedAsConfigurableAttribute.cs
-System.ComponentModel/ReferenceConverter.cs
-System.ComponentModel/ReflectionEventDescriptor.cs
-System.ComponentModel/ReflectionPropertyDescriptor.cs
-System.ComponentModel/RefreshEventArgs.cs
-System.ComponentModel/RefreshEventHandler.cs
-System.ComponentModel/RefreshPropertiesAttribute.cs
-System.ComponentModel/RefreshProperties.cs
-System.ComponentModel/RunInstallerAttribute.cs
-System.ComponentModel/RunWorkerCompletedEventArgs.cs
-System.ComponentModel/RunWorkerCompletedEventHandler.cs
-System.ComponentModel/SByteConverter.cs
-System.ComponentModel/SettingsBindableAttribute.cs
-System.ComponentModel/SingleConverter.cs
-System.ComponentModel/StringConverter.cs
-System.ComponentModel/SyntaxCheck.cs
-System.ComponentModel/TimeSpanConverter.cs
-System.ComponentModel/ToolboxItemAttribute.cs
-System.ComponentModel/ToolboxItemFilterAttribute.cs
-System.ComponentModel/ToolboxItemFilterType.cs
-System.ComponentModel/TypeConverterAttribute.cs
-System.ComponentModel/TypeConverter.cs
-System.ComponentModel/TypeDescriptionProvider.cs
-System.ComponentModel/TypeDescriptionProviderAttribute.cs
-System.ComponentModel/TypeDescriptor.cs
-System.ComponentModel/TypeListConverter.cs
-System.ComponentModel/UInt16Converter.cs
-System.ComponentModel/UInt32Converter.cs
-System.ComponentModel/UInt64Converter.cs
-System.ComponentModel/WarningException.cs
-System.ComponentModel/WeakObjectWrapper.cs
-System.ComponentModel/WeakObjectWrapperComparer.cs
-System.ComponentModel/Win32Exception.cs
-System.Configuration/ApplicationScopedSettingAttribute.cs
-System.Configuration/ApplicationSettingsBase.cs
-System.Configuration/ApplicationSettingsGroup.cs
-System.Configuration/AppSettingsReader.cs
-System.Configuration/ClientSettingsSection.cs
-System.Configuration/ConfigHelper.cs
-System.Configuration/ConfigurationException.cs
-System.Configuration/ConfigurationSettings.cs
-System.Configuration/ConfigXmlDocument.cs
-System.Configuration/CustomizableFileSettingsProvider.cs
-System.Configuration/DefaultSettingValueAttribute.cs
-System.Configuration/DictionarySectionHandler.cs
-System.Configuration/IApplicationSettingsProvider.cs
-System.Configuration/IConfigurationSectionHandler.cs
-System.Configuration/IConfigurationSystem.cs
-System.Configuration/IConfigXmlNode.cs
-System.Configuration/IdnElement.cs
-System.Configuration/IgnoreSectionHandler.cs
-System.Configuration/IriParsingElement.cs
-System.Configuration/IPersistComponentSettings.cs
-System.Configuration/ISettingsProviderService.cs
-System.Configuration/LocalFileSettingsProvider.cs
-System.Configuration/NameValueFileSectionHandler.cs
-System.Configuration/NameValueSectionHandler.cs
-System.Configuration/NoSettingsVersionUpgradeAttribute.cs
-System.Configuration/SettingAttribute.cs
-System.Configuration/SettingChangingEventArgs.cs
-System.Configuration/SettingChangingEventHandler.cs
-System.Configuration/SettingElementCollection.cs
-System.Configuration/SettingElement.cs
-System.Configuration/SettingsAttributeDictionary.cs
-System.Configuration/SettingsBase.cs
-System.Configuration/SettingsContext.cs
-System.Configuration/SettingsLoadedEventArgs.cs
-System.Configuration/SettingsLoadedEventHandler.cs
-System.Configuration/SettingsPropertyCollection.cs
-System.Configuration/SettingsProperty.cs
-System.Configuration/SettingsPropertyIsReadOnlyException.cs
-System.Configuration/SettingsPropertyNotFoundException.cs
-System.Configuration/SettingsPropertyValueCollection.cs
-System.Configuration/SettingsPropertyValue.cs
-System.Configuration/SettingsPropertyWrongTypeException.cs
-System.Configuration/SettingsProviderAttribute.cs
-System.Configuration/SettingsProviderCollection.cs
-System.Configuration/SettingsProvider.cs
-System.Configuration/SettingsSavingEventHandler.cs
-System.Configuration/SettingsSerializeAsAttribute.cs
-System.Configuration/SettingsSerializeAs.cs
-System.Configuration/SettingValueElement.cs
-System.Configuration/SettingsManageability.cs
-System.Configuration/SettingsManageabilityAttribute.cs
-System.Configuration/SettingsGroupDescriptionAttribute.cs
-System.Configuration/SettingsDescriptionAttribute.cs
-System.Configuration/SettingsGroupNameAttribute.cs
-System.Configuration/SingleTagSectionHandler.cs
-System.Configuration/SpecialSetting.cs
-System.Configuration/SpecialSettingAttribute.cs
-System.Configuration/UriSection.cs
-System.Configuration/UserSettingsGroup.cs
-System.Configuration/UserScopedSettingAttribute.cs
-System/DefaultUriParser.cs
-System.Diagnostics/AlphabeticalEnumConverter.cs
-System.Diagnostics/BooleanSwitch.cs
-System.Diagnostics/ConsoleTraceListener.cs
-System.Diagnostics/CorrelationManager.cs
-System.Diagnostics/CounterCreationDataCollection.cs
-System.Diagnostics/CounterCreationData.cs
-System.Diagnostics/CounterSampleCalculator.cs
-System.Diagnostics/CounterSample.cs
-System.Diagnostics/DataReceivedEventArgs.cs
-System.Diagnostics/DataReceivedEventHandler.cs
-System.Diagnostics/Debug.cs
-System.Diagnostics/DefaultTraceListener.cs
-System.Diagnostics/DelimitedListTraceListener.cs
-System.Diagnostics/DiagnosticsConfigurationHandler.cs
-System.Diagnostics/EntryWrittenEventArgs.cs
-System.Diagnostics/EntryWrittenEventHandler.cs
-System.Diagnostics/EventInstance.cs
-System.Diagnostics/EventLog.cs
-System.Diagnostics/EventLogEntryCollection.cs
-System.Diagnostics/EventLogEntry.cs
-System.Diagnostics/EventLogEntryType.cs
-System.Diagnostics/EventLogImpl.cs
-System.Diagnostics/EventLogInstaller.cs
-System.Diagnostics/EventLogPermissionAccess.cs
-System.Diagnostics/EventLogPermissionAttribute.cs
-System.Diagnostics/EventLogPermission.cs
-System.Diagnostics/EventLogPermissionEntryCollection.cs
-System.Diagnostics/EventLogPermissionEntry.cs
-System.Diagnostics/EventLogTraceListener.cs
-System.Diagnostics/EventSourceCreationData.cs
-System.Diagnostics/EventTypeFilter.cs
-System.Diagnostics/FileVersionInfo.cs
-System.Diagnostics/ICollectData.cs
-System.Diagnostics/InstanceDataCollectionCollection.cs
-System.Diagnostics/InstanceDataCollection.cs
-System.Diagnostics/InstanceData.cs
-System.Diagnostics/LocalFileEventLog.cs
-System.Diagnostics/MonitoringDescriptionAttribute.cs
-System.Diagnostics/NullEventLog.cs
-System.Diagnostics/OverflowAction.cs
-System.Diagnostics/PerformanceCounterCategory.cs
-System.Diagnostics/PerformanceCounterCategoryType.cs
-System.Diagnostics/PerformanceCounter.cs
-System.Diagnostics/PerformanceCounterInstaller.cs
-System.Diagnostics/PerformanceCounterInstanceLifetime.cs
-System.Diagnostics/PerformanceCounterManager.cs
-System.Diagnostics/PerformanceCounterPermissionAccess.cs
-System.Diagnostics/PerformanceCounterPermissionAttribute.cs
-System.Diagnostics/PerformanceCounterPermission.cs
-System.Diagnostics/PerformanceCounterPermissionEntryCollection.cs
-System.Diagnostics/PerformanceCounterPermissionEntry.cs
-System.Diagnostics/PerformanceCounterType.cs
-System.Diagnostics/Process.cs
-System.Diagnostics/ProcessModuleCollection.cs
-System.Diagnostics/ProcessModule.cs
-System.Diagnostics/ProcessPriorityClass.cs
-System.Diagnostics/ProcessStartInfo.cs
-System.Diagnostics/ProcessThreadCollection.cs
-System.Diagnostics/ProcessThread.cs
-System.Diagnostics/ProcessWindowStyle.cs
-System.Diagnostics/SourceFilter.cs
-System.Diagnostics/SourceLevels.cs
-System.Diagnostics/SourceSwitch.cs
-System.Diagnostics/Switch.cs
-System.Diagnostics/SwitchAttribute.cs
-System.Diagnostics/SwitchLevelAttribute.cs
-System.Diagnostics/Stopwatch.cs
-System.Diagnostics/TextWriterTraceListener.cs
-System.Diagnostics/ThreadPriorityLevel.cs
-System.Diagnostics/ThreadState.cs
-System.Diagnostics/ThreadWaitReason.cs
-System.Diagnostics/Trace.cs
-System.Diagnostics/TraceEventCache.cs
-System.Diagnostics/TraceEventType.cs
-System.Diagnostics/TraceFilter.cs
-System.Diagnostics/TraceImpl.cs
-System.Diagnostics/TraceLevel.cs
-System.Diagnostics/TraceListenerCollection.cs
-System.Diagnostics/TraceListener.cs
-System.Diagnostics/TraceOptions.cs
-System.Diagnostics/TraceSource.cs
-System.Diagnostics/TraceSourceInfo.cs
-System.Diagnostics/TraceSwitch.cs
-System.Diagnostics/Win32EventLog.cs
-System.Diagnostics/XmlWriterTraceListener.cs
-System.Diagnostics.CodeAnalysis/ExcludeFromCodeCoverageAttribute.cs
-System/FileStyleUriParser.cs
-System/FtpStyleUriParser.cs
-System/GenericUriParser.cs
-System/GenericUriParserOptions.cs
-System/GopherStyleUriParser.cs
-System/HttpStyleUriParser.cs
-System/Platform.cs
-System.IO.Compression/CompressionLevel.cs
-System.IO.Compression/CompressionMode.cs
-System.IO.Compression/DeflateStream.cs
-System.IO.Compression/GZipStream.cs
-System.IO/DefaultWatcher.cs
-System.IO/ErrorEventArgs.cs
-System.IO/ErrorEventHandler.cs
-System.IO/FAMWatcher.cs
-System.IO/NullFileWatcher.cs
-System.IO/FileAction.cs
-System.IO/FileSystemEventArgs.cs
-System.IO/FileSystemEventHandler.cs
-System.IO/FileSystemWatcher.cs
-System.IO/IFileWatcher.cs
-System.IO/InotifyWatcher.cs
-System.IO/InternalBufferOverflowException.cs
-System.IO/InvalidDataException.cs
-System.IO/IODescriptionAttribute.cs
-System.IO/KeventWatcher.cs
-System.IO/MonoSyncFileStream.cs
-System.IO/NotifyFilters.cs
-System.IO.Ports/Handshake.cs
-System.IO.Ports/ISerialStream.cs
-System.IO.Ports/Parity.cs
-System.IO.Ports/SerialData.cs
-System.IO.Ports/SerialError.cs
-System.IO.Ports/SerialErrorEventArgs.cs
-System.IO.Ports/SerialPinChange.cs
-System.IO.Ports/SerialPinChangedEventArgs.cs
-System.IO.Ports/SerialPort.cs
-System.IO.Ports/SerialPortStream.cs
-System.IO.Ports/SerialReceivedEventArgs.cs
-System.IO.Ports/SerialSignal.cs
-System.IO.Ports/StopBits.cs
-System.IO.Ports/WinSerialStream.cs
-System.IO/RenamedEventArgs.cs
-System.IO/RenamedEventHandler.cs
-System.IO/SearchPattern.cs
-System.IO/WaitForChangedResult.cs
-System.IO/WatcherChangeTypes.cs
-System.IO/WindowsWatcher.cs
-System/LdapStyleUriParser.cs
-System.Media/AudioData.cs
-System.Media/AudioDevice.cs
-System.Media/SoundPlayer.cs
-System.Media/SystemSound.cs
-System.Media/SystemSounds.cs
-System.Media/Win32SoundPlayer.cs
-System.Net/AuthenticationManager.cs
-System.Net/AuthenticationSchemes.cs
-System.Net/AuthenticationSchemeSelector.cs
-System.Net/Authorization.cs
-System.Net/BasicClient.cs
-System.Net/BindIPEndPoint.cs
-System.Net.Cache/HttpCacheAgeControl.cs
-System.Net.Cache/HttpRequestCacheLevel.cs
-System.Net.Cache/HttpRequestCachePolicy.cs
-System.Net.Cache/RequestCacheLevel.cs
-System.Net.Cache/RequestCachePolicy.cs
-System.Net/ChunkedInputStream.cs
-System.Net/ChunkStream.cs
-System.Net.Configuration/AuthenticationModuleElementCollection.cs
-System.Net.Configuration/AuthenticationModuleElement.cs
-System.Net.Configuration/AuthenticationModulesSection.cs
-System.Net.Configuration/BypassElementCollection.cs
-System.Net.Configuration/BypassElement.cs
-System.Net.Configuration/ConnectionManagementElementCollection.cs
-System.Net.Configuration/ConnectionManagementElement.cs
-System.Net.Configuration/ConnectionManagementHandler.cs
-System.Net.Configuration/ConnectionManagementSection.cs
-System.Net.Configuration/DefaultProxyHandler.cs
-System.Net.Configuration/DefaultProxySection.cs
-System.Net.Configuration/FtpCachePolicyElement.cs
-System.Net.Configuration/HttpCachePolicyElement.cs
-System.Net.Configuration/HttpWebRequestElement.cs
-System.Net.Configuration/Ipv6Element.cs
-System.Net.Configuration/MailSettingsSectionGroup.cs
-System.Net.Configuration/ModuleElement.cs
-System.Net.Configuration/NetAuthenticationModuleHandler.cs
-System.Net.Configuration/NetConfigurationHandler.cs
-System.Net.Configuration/NetSectionGroup.cs
-System.Net.Configuration/PerformanceCountersElement.cs
-System.Net.Configuration/ProxyElement.cs
-System.Net.Configuration/RequestCachingSection.cs
-System.Net.Configuration/ServicePointManagerElement.cs
-System.Net.Configuration/SettingsSection.cs
-System.Net.Configuration/SmtpNetworkElement.cs
-System.Net.Configuration/SmtpSection.cs
-System.Net.Configuration/SmtpSpecifiedPickupDirectoryElement.cs
-System.Net.Configuration/SocketElement.cs
-System.Net.Configuration/WebProxyScriptElement.cs
-System.Net.Configuration/WebRequestModuleElementCollection.cs
-System.Net.Configuration/WebRequestModuleElement.cs
-System.Net.Configuration/WebRequestModuleHandler.cs
-System.Net.Configuration/WebRequestModulesSection.cs
-System.Net/ConnectionModes.cs
-System.Net/CookieCollection.cs
-System.Net/CookieContainer.cs
-System.Net/Cookie.cs
-System.Net/CookieException.cs
-System.Net/CookieParser.cs
-System.Net/CredentialCache.cs
-System.Net/DecompressionMethods.cs
-System.Net/DefaultCertificatePolicy.cs
-System.Net/DigestClient.cs
-System.Net/Dns.cs
-System.Net/DnsEndPoint.cs
-System.Net/DnsPermissionAttribute.cs
-System.Net/DnsPermission.cs
-System.Net/EndPoint.cs
-System.Net/EndPointListener.cs
-System.Net/EndPointManager.cs
-System.Net/EndpointPermission.cs
-System.Net/FileWebRequestCreator.cs
-System.Net/FileWebRequest.cs
-System.Net/FileWebResponse.cs
-System.Net/FtpAsyncResult.cs
-System.Net/FtpDataStream.cs
-System.Net/FtpRequestCreator.cs
-System.Net/FtpStatusCode.cs
-System.Net/FtpWebRequest.cs
-System.Net/FtpStatus.cs
-System.Net/FtpWebResponse.cs
-System.Net/GlobalProxySelection.cs
-System.Net/HttpConnection.cs
-System.Net/HttpContinueDelegate.cs
-System.Net/HttpListenerBasicIdentity.cs
-System.Net/HttpListenerContext.cs
-System.Net/HttpListener.cs
-System.Net/HttpListenerException.cs
-System.Net/HttpListenerPrefixCollection.cs
-System.Net/HttpListenerRequest.cs
-System.Net/HttpListenerResponse.cs
-System.Net/HttpRequestCreator.cs
-System.Net/HttpRequestHeader.cs
-System.Net/HttpResponseHeader.cs
-System.Net/HttpStatusCode.cs
-System.Net/HttpStreamAsyncResult.cs
-System.Net/HttpUtility.cs
-System.Net/HttpVersion.cs
-System.Net/HttpWebRequest.cs
-System.Net/HttpWebResponse.cs
-System.Net/IAuthenticationModule.cs
-System.Net/ICertificatePolicy.cs
-System.Net/ICredentialLookup.cs
-System.Net/ICredentialPolicy.cs
-System.Net/ICredentialsByHost.cs
-System.Net/IPAddress.cs
-System.Net/IPEndPoint.cs
-System.Net/IPHostEntry.cs
-System.Net/IPv6Address.cs
-System.Net/IWebProxy.cs
-System.Net/IWebProxyScript.cs
-System.Net/IWebConnectionState.cs
-System.Net/IWebRequestCreate.cs
-System.Net/ListenerAsyncResult.cs
-System.Net/ListenerPrefix.cs
-System.Net.Mail/AlternateViewCollection.cs
-System.Net.Mail/AlternateView.cs
-System.Net.Mail/AttachmentBase.cs
-System.Net.Mail/AttachmentCollection.cs
-System.Net.Mail/Attachment.cs
-System.Net.Mail/DeliveryNotificationOptions.cs
-System.Net.Mail/LinkedResourceCollection.cs
-System.Net.Mail/LinkedResource.cs
-System.Net.Mail/MailAddressCollection.cs
-System.Net.Mail/MailAddress.cs
-System.Net.Mail/MailMessage.cs
-System.Net.Mail/MailPriority.cs
-System.Net.Mail/SendCompletedEventHandler.cs
-System.Net.Mail/SmtpAccess.cs
-System.Net.Mail/SmtpClient.cs
-System.Net.Mail/SmtpDeliveryMethod.cs
-System.Net.Mail/SmtpException.cs
-System.Net.Mail/SmtpFailedRecipientException.cs
-System.Net.Mail/SmtpFailedRecipientsException.cs
-System.Net.Mail/SmtpPermission.cs
-System.Net.Mail/SmtpPermissionAttribute.cs
-System.Net.Mail/SmtpStatusCode.cs
-System.Net.Mime/ContentDisposition.cs
-System.Net.Mime/ContentType.cs
-System.Net.Mime/DispositionTypeNames.cs
-System.Net.Mime/MediaTypeNames.cs
-System.Net.Mime/TransferEncoding.cs
-System.Net/MacProxy.cs
-System.Net/MonoHttpDate.cs
-System.Net/NetConfig.cs
-System.Net/NetworkAccess.cs
-System.Net/NetworkCredential.cs
-System.Net.NetworkInformation/DuplicateAddressDetectionState.cs
-System.Net.NetworkInformation/GatewayIPAddressInformationCollection.cs
-System.Net.NetworkInformation/GatewayIPAddressInformation.cs
-System.Net.NetworkInformation/IcmpV4Statistics.cs
-System.Net.NetworkInformation/IcmpV6Statistics.cs
-System.Net.NetworkInformation/IPAddressCollection.cs
-System.Net.NetworkInformation/IPAddressInformationCollection.cs
-System.Net.NetworkInformation/IPAddressInformation.cs
-System.Net.NetworkInformation/IPGlobalProperties.cs
-System.Net.NetworkInformation/IPGlobalStatistics.cs
-System.Net.NetworkInformation/IPInterfaceProperties.cs
-System.Net.NetworkInformation/IPStatus.cs
-System.Net.NetworkInformation/IPv4InterfaceProperties.cs
-System.Net.NetworkInformation/IPv4InterfaceStatistics.cs
-System.Net.NetworkInformation/IPv6InterfaceProperties.cs
-System.Net.NetworkInformation/LinuxNetworkInterfaceMarshal.cs
-System.Net.NetworkInformation/MacOsNetworkInterfaceMarshal.cs
-System.Net.NetworkInformation/MulticastIPAddressInformationCollection.cs
-System.Net.NetworkInformation/MulticastIPAddressInformation.cs
-System.Net.NetworkInformation/NetBiosNodeType.cs
-System.Net.NetworkInformation/NetworkAddressChangedEventHandler.cs
-System.Net.NetworkInformation/NetworkAvailabilityChangedEventHandler.cs
-System.Net.NetworkInformation/NetworkAvailabilityEventArgs.cs
-System.Net.NetworkInformation/NetworkChange.cs
-System.Net.NetworkInformation/NetworkInformationAccess.cs
-System.Net.NetworkInformation/NetworkInformationException.cs
-System.Net.NetworkInformation/NetworkInformationPermissionAttribute.cs
-System.Net.NetworkInformation/NetworkInformationPermission.cs
-System.Net.NetworkInformation/NetworkInterfaceComponent.cs
-System.Net.NetworkInformation/NetworkInterface.cs
-System.Net.NetworkInformation/NetworkInterfaceType.cs
-System.Net.NetworkInformation/OperationalStatus.cs
-System.Net.NetworkInformation/PhysicalAddress.cs
-System.Net.NetworkInformation/PingCompletedEventArgs.cs
-System.Net.NetworkInformation/PingCompletedEventHandler.cs
-System.Net.NetworkInformation/Ping.cs
-System.Net.NetworkInformation/PingException.cs
-System.Net.NetworkInformation/PingOptions.cs
-System.Net.NetworkInformation/PingReply.cs
-System.Net.NetworkInformation/PrefixOrigin.cs
-System.Net.NetworkInformation/SuffixOrigin.cs
-System.Net.NetworkInformation/TcpConnectionInformation.cs
-System.Net.NetworkInformation/TcpState.cs
-System.Net.NetworkInformation/TcpStatistics.cs
-System.Net.NetworkInformation/UdpStatistics.cs
-System.Net.NetworkInformation/UnicastIPAddressInformationCollection.cs
-System.Net.NetworkInformation/UnicastIPAddressInformation.cs
-System.Net.NetworkInformation/Win32NetworkInterfaceMarshal.cs
-System.Net/NtlmClient.cs
-System/NetPipeStyleUriParser.cs
-System.Net/ProtocolViolationException.cs
-System.Net/RequestStream.cs
-System.Net/ResponseStream.cs
-System.Net.Security/AuthenticatedStream.cs
-System.Net.Security/AuthenticationLevel.cs
-System.Net.Security/LocalCertificateSelectionCallback.cs
-System.Net.Security/NegotiateStream.cs
-System.Net.Security/ProtectionLevel.cs
-System.Net/SecurityProtocolType.cs
-System.Net.Security/RemoteCertificateValidationCallback.cs
-System.Net.Security/SslStream.cs
-System.Net.Security/SslPolicyErrors.cs
-System.Net/ServicePoint.cs
-System.Net/ServicePointManager.cs
-System.Net/ServicePointManager.extra.cs
-System.Net/SimpleAsyncResult.cs
-System.Net/SocketAddress.cs
-System.Net/SocketPermissionAttribute.cs
-System.Net/SocketPermission.cs
-System.Net.Sockets/AddressFamily.cs
-System.Net.Sockets/IOControlCode.cs
-System.Net.Sockets/IPv6MulticastOption.cs
-System.Net.Sockets/IPPacketInformation.cs
-System.Net.Sockets/LingerOption.cs
-System.Net.Sockets/MulticastOption.cs
-System.Net.Sockets/NetworkStream.cs
-System.Net.Sockets/ProtocolFamily.cs
-System.Net.Sockets/ProtocolType.cs
-System.Net.Sockets/SelectMode.cs
-System.Net.Sockets/SendPacketsElement.cs
-System.Net.Sockets/Socket.cs
-System.Net.Sockets/Socket_2_1.cs
-System.Net.Sockets/SocketAsyncEventArgs.cs
-System.Net.Sockets/SocketAsyncOperation.cs
-System.Net.Sockets/SocketError.cs
-System.Net.Sockets/SocketException.cs
-System.Net.Sockets/SocketFlags.cs
-System.Net.Sockets/SocketInformation.cs
-System.Net.Sockets/SocketInformationOptions.cs
-System.Net.Sockets/SocketOptionLevel.cs
-System.Net.Sockets/SocketOptionName.cs
-System.Net.Sockets/SocketShutdown.cs
-System.Net.Sockets/SocketType.cs
-System.Net.Sockets/TcpClient.cs
-System.Net.Sockets/TcpListener.cs
-System.Net.Sockets/TransmitFileOptions.cs
-System.Net.Sockets/UdpClient.cs
-System.Net.Sockets/UdpReceiveResult.cs
-System/NetTcpStyleUriParser.cs
-System.Net/TransportContext.cs
-System.Net/TransportType.cs
-System.Net/WebAsyncResult.cs
-System.Net/WebClient.cs
-System.Net/WebConnection.cs
-System.Net/WebConnectionData.cs
-System.Net/WebConnectionGroup.cs
-System.Net/WebConnectionStream.cs
-System.Net/WebException.cs
-System.Net/WebExceptionStatus.cs
-System.Net/WebHeaderCollection.cs
-System.Net/WebPermissionAttribute.cs
-System.Net/WebPermission.cs
-System.Net/WebProxy.cs
-System.Net/WebRequest.cs
-System.Net/WebRequestMethods.cs
-System.Net/WebResponse.cs
-System.Net/WebUtility.cs
-System.Net.WebSockets/ClientWebSocket.cs
-System.Net.WebSockets/ClientWebSocketOptions.cs
-System.Net.WebSockets/HttpListenerWebSocketContext.cs
-System.Net.WebSockets/WebSocket.cs
-System.Net.WebSockets/WebSocketCloseStatus.cs
-System.Net.WebSockets/WebSocketContext.cs
-System.Net.WebSockets/WebSocketError.cs
-System.Net.WebSockets/WebSocketException.cs
-System.Net.WebSockets/WebSocketMessageType.cs
-System.Net.WebSockets/WebSocketReceiveResult.cs
-System.Net.WebSockets/WebSocketState.cs
-System/NewsStyleUriParser.cs
-System.Runtime.Versioning/FrameworkName.cs
-System.Security.AccessControl/SemaphoreAccessRule.cs
-System.Security.AccessControl/SemaphoreAuditRule.cs
-System.Security.AccessControl/SemaphoreRights.cs
-System.Security.AccessControl/SemaphoreSecurity.cs
-System.Security.Authentication/AuthenticationException.cs
-System.Security.Authentication/CipherAlgorithmType.cs
-System.Security.Authentication/ExchangeAlgorithmType.cs
-System.Security.Authentication/HashAlgorithmType.cs
-System.Security.Authentication/SslProtocols.cs
-System.Security.Authentication/InvalidCredentialException.cs
-System.Security.Authentication.ExtendedProtection/ChannelBinding.cs
-System.Security.Authentication.ExtendedProtection/ChannelBindingKind.cs
-System.Security.Authentication.ExtendedProtection/ExtendedProtectionPolicy.cs
-System.Security.Authentication.ExtendedProtection/ExtendedProtectionPolicyTypeConverter.cs
-System.Security.Authentication.ExtendedProtection/PolicyEnforcement.cs
-System.Security.Authentication.ExtendedProtection/ProtectionScenario.cs
-System.Security.Authentication.ExtendedProtection/ServiceNameCollection.cs
-System.Security.Authentication.ExtendedProtection.Configuration/ConfigUtil.cs
-System.Security.Authentication.ExtendedProtection.Configuration/ExtendedProtectionPolicyElement.cs
-System.Security.Authentication.ExtendedProtection.Configuration/ServiceNameElement.cs
-System.Security.Authentication.ExtendedProtection.Configuration/ServiceNameElementCollection.cs
-System.Security.Cryptography/AsnEncodedDataCollection.cs
-System.Security.Cryptography/AsnEncodedData.cs
-System.Security.Cryptography/AsnEncodedDataEnumerator.cs
-System.Security.Cryptography/OidCollection.cs
-System.Security.Cryptography/Oid.cs
-System.Security.Cryptography/OidEnumerator.cs
-System.Security.Cryptography.X509Certificates/OpenFlags.cs
-System.Security.Cryptography.X509Certificates/OSX509Certificates.cs
-System.Security.Cryptography.X509Certificates/PublicKey.cs
-System.Security.Cryptography.X509Certificates/StoreLocation.cs
-System.Security.Cryptography.X509Certificates/StoreName.cs
-System.Security.Cryptography.X509Certificates/X500DistinguishedName.cs
-System.Security.Cryptography.X509Certificates/X500DistinguishedNameFlags.cs
-System.Security.Cryptography.X509Certificates/X509BasicConstraintsExtension.cs
-System.Security.Cryptography.X509Certificates/X509Certificate2Collection.cs
-System.Security.Cryptography.X509Certificates/X509Certificate2.cs
-System.Security.Cryptography.X509Certificates/X509Certificate2Enumerator.cs
-System.Security.Cryptography.X509Certificates/X509CertificateCollection.cs
-System.Security.Cryptography.X509Certificates/X509Chain.cs
-System.Security.Cryptography.X509Certificates/X509ChainElementCollection.cs
-System.Security.Cryptography.X509Certificates/X509ChainElement.cs
-System.Security.Cryptography.X509Certificates/X509ChainElementEnumerator.cs
-System.Security.Cryptography.X509Certificates/X509ChainPolicy.cs
-System.Security.Cryptography.X509Certificates/X509ChainStatus.cs
-System.Security.Cryptography.X509Certificates/X509ChainStatusFlags.cs
-System.Security.Cryptography.X509Certificates/X509EnhancedKeyUsageExtension.cs
-System.Security.Cryptography.X509Certificates/X509ExtensionCollection.cs
-System.Security.Cryptography.X509Certificates/X509Extension.cs
-System.Security.Cryptography.X509Certificates/X509ExtensionEnumerator.cs
-System.Security.Cryptography.X509Certificates/X509FindType.cs
-System.Security.Cryptography.X509Certificates/X509IncludeOption.cs
-System.Security.Cryptography.X509Certificates/X509KeyUsageExtension.cs
-System.Security.Cryptography.X509Certificates/X509KeyUsageFlags.cs
-System.Security.Cryptography.X509Certificates/X509NameType.cs
-System.Security.Cryptography.X509Certificates/X509RevocationFlag.cs
-System.Security.Cryptography.X509Certificates/X509RevocationMode.cs
-System.Security.Cryptography.X509Certificates/X509Store.cs
-System.Security.Cryptography.X509Certificates/X509SubjectKeyIdentifierExtension.cs
-System.Security.Cryptography.X509Certificates/X509SubjectKeyIdentifierHashAlgorithm.cs
-System.Security.Cryptography.X509Certificates/X509VerificationFlags.cs
-System.Security.Permissions/PermissionHelper.cs
-System.Security.Permissions/ResourcePermissionBase.cs
-System.Security.Permissions/ResourcePermissionBaseEntry.cs
-System.Security.Permissions/StorePermissionAttribute.cs
-System.Security.Permissions/StorePermission.cs
-System.Security.Permissions/StorePermissionFlags.cs
-System/SRDescriptionAttribute.cs
-System.Threading/Semaphore.cs
-System.Threading/SemaphoreFullException.cs
-System.Threading/ThreadExceptionEventArgs.cs
-System.Threading/ThreadExceptionEventHandler.cs
-System.Threading/Barrier.cs
-System.Threading/BarrierPostPhaseException.cs
-System.Timers/ElapsedEventArgs.cs
-System.Timers/ElapsedEventHandler.cs
-System.Timers/Timer.cs
-System.Timers/TimersDescriptionAttribute.cs
-System/UriBuilder.cs
-System/UriComponents.cs
-System/Uri.cs
-System/UriFormat.cs
-System/UriFormatException.cs
-System/UriHostNameType.cs
-System/UriHelper.cs
-System/UriIdnScope.cs
-System/UriKind.cs
-System/UriParser.cs
-System/UriPartial.cs
-System/UriTypeConverter.cs
-System/UriElements.cs
-System/UriParseComponents.cs
-System.Web/AspNetHostingPermissionAttribute.cs
-System.Web/AspNetHostingPermission.cs
-System.Web/AspNetHostingPermissionLevel.cs
-System.ComponentModel/ProgressChangedEventHandler.cs
-System.ComponentModel/ProgressChangedEventArgs.cs
-System.Net/UploadDataCompletedEventArgs.cs
-System.Net/UploadFileCompletedEventArgs.cs
-System.Net/UploadFileCompletedEventHandler.cs
-System.Net/UploadProgressChangedEventHandler.cs
-System.Net/OpenReadCompletedEventHandler.cs
-System.Net/DownloadDataCompletedEventHandler.cs
-System.Net/DownloadProgressChangedEventHandler.cs
-System.Net/OpenReadCompletedEventArgs.cs
-System.Net/DownloadStringCompletedEventArgs.cs
-System.Net/DownloadDataCompletedEventArgs.cs
-System.Net/DownloadProgressChangedEventArgs.cs
-System.Net/UploadStringCompletedEventArgs.cs
-System.Net/OpenWriteCompletedEventArgs.cs
-System.Net/UploadProgressChangedEventArgs.cs
-System.Net/OpenWriteCompletedEventHandler.cs
-System.Net/UploadDataCompletedEventHandler.cs
-System.Net/UploadValuesCompletedEventArgs.cs
-System.Net/UploadValuesCompletedEventHandler.cs
-System.Net/UploadStringCompletedEventHandler.cs
-System.Net/DownloadStringCompletedEventHandler.cs
-System.Runtime.InteropServices/DefaultParameterValueAttribute.cs
-System.Runtime.InteropServices/HandleCollector.cs
-System.Runtime.InteropServices/StandardOleMarshalObject.cs
-System.Runtime.InteropServices.ComTypes/ADVF.cs
-System.Runtime.InteropServices.ComTypes/DATADIR.cs
-System.Runtime.InteropServices.ComTypes/DVASPECT.cs
-System.Runtime.InteropServices.ComTypes/FORMATETC.cs
-System.Runtime.InteropServices.ComTypes/IAdviseSink.cs
-System.Runtime.InteropServices.ComTypes/IDataObject.cs
-System.Runtime.InteropServices.ComTypes/IEnumFORMATETC.cs
-System.Runtime.InteropServices.ComTypes/IEnumSTATDATA.cs
-System.Runtime.InteropServices.ComTypes/STATDATA.cs
-System.Runtime.InteropServices.ComTypes/STGMEDIUM.cs
-System.Runtime.InteropServices.ComTypes/TYMED.cs
-System/IUriData.cs
-System/UriData.cs
-Mono.Net.Dns/DnsClass.cs
-Mono.Net.Dns/DnsHeader.cs
-Mono.Net.Dns/DnsOpCode.cs
-Mono.Net.Dns/DnsPacket.cs
-Mono.Net.Dns/DnsQClass.cs
-Mono.Net.Dns/DnsQType.cs
-Mono.Net.Dns/DnsQuery.cs
-Mono.Net.Dns/DnsQuestion.cs
-Mono.Net.Dns/DnsRCode.cs
-Mono.Net.Dns/DnsResourceRecordA.cs
-Mono.Net.Dns/DnsResourceRecordAAAA.cs
-Mono.Net.Dns/DnsResourceRecordCName.cs
-Mono.Net.Dns/DnsResourceRecord.cs
-Mono.Net.Dns/DnsResourceRecordIPAddress.cs
-Mono.Net.Dns/DnsResourceRecordPTR.cs
-Mono.Net.Dns/DnsResponse.cs
-Mono.Net.Dns/DnsType.cs
-Mono.Net.Dns/DnsUtil.cs
-Mono.Net.Dns/ResolverAsyncOperation.cs
-Mono.Net.Dns/SimpleResolver.cs
-Mono.Net.Dns/ResolverError.cs
-Mono.Net.Dns/SimpleResolverEventArgs.cs
-System.Net/DnsAsyncResult.cs
-System.Windows.Input/ICommand.cs
-
-../../../external/referencesource/System/regex/system/text/regularexpressions/Regex.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexBoyerMoore.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCapture.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCaptureCollection.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCharClass.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCode.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCompilationInfo.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCompiler.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexFCD.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexGroup.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexGroupCollection.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexInterpreter.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexMatch.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexMatchCollection.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexMatchTimeoutException.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexNode.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexOptions.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexParser.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexReplacement.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexRunner.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexRunnerFactory.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexTree.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/RegexWriter.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/compiledregexrunner.cs
-../../../external/referencesource/System/regex/system/text/regularexpressions/compiledregexrunnerfactory.cs
\ No newline at end of file
Mono.Http/NtlmClient.cs
System.CodeDom.Compiler/GeneratedCodeAttribute.cs
System.CodeDom.Compiler/IndentedTextWriter.cs
-System.Collections.Generic/ISet.cs
-System.Collections.Generic/LinkedList.cs
-System.Collections.Generic/LinkedListNode.cs
-System.Collections.Generic/RBTree.cs
-System.Collections.Generic/Queue.cs
-System.Collections.Generic/SortedDictionary.cs
-System.Collections.Generic/SortedList.cs
-System.Collections.Generic/SortedSet.cs
-System.Collections.Generic/Stack.cs
System.Collections.ObjectModel/ObservableCollection.cs
System.Collections.ObjectModel/ReadOnlyObservableCollection.cs
System.Collections.Specialized/BitVector32.cs
../../../external/referencesource/System/sys/system/collections/concurrent/BlockingCollection.cs
../../../external/referencesource/System/sys/system/collections/concurrent/ConcurrentBag.cs
+../../../external/referencesource/System/compmod/system/collections/generic/bithelper.cs
+../../../external/referencesource/System/compmod/system/collections/generic/debugview.cs
+../../../external/referencesource/System/compmod/system/collections/generic/iset.cs
+../../../external/referencesource/System/compmod/system/collections/generic/linkedlist.cs
+../../../external/referencesource/System/compmod/system/collections/generic/queue.cs
+../../../external/referencesource/System/compmod/system/collections/generic/sorteddictionary.cs
+../../../external/referencesource/System/compmod/system/collections/generic/sortedlist.cs
+../../../external/referencesource/System/compmod/system/collections/generic/sortedset.cs
+../../../external/referencesource/System/compmod/system/collections/generic/sortedsetdebugview.cs
+../../../external/referencesource/System/compmod/system/collections/generic/stack.cs
+../../../external/referencesource/System/compmod/system/collections/generic/throwhelper.cs