using System.Collections.Generic; using System.Diagnostics; namespace JD.Collections { internal sealed class CollectionDebugView { readonly private ICollection collection; public CollectionDebugView(ICollection collection) { if (collection == null) { ThrowHelper.ThrowArgumentNullException(); } this.collection = collection; } [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] public T[] Items { get { T[] array = new T[this.collection.Count]; this.collection.CopyTo(array, 0); return array; } } } }