30 lines
No EOL
740 B
C#
30 lines
No EOL
740 B
C#
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
|
|
namespace JD.Collections
|
|
{
|
|
internal sealed class CollectionDebugView<T>
|
|
{
|
|
readonly private ICollection<T> collection;
|
|
|
|
public CollectionDebugView(ICollection<T> 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;
|
|
}
|
|
}
|
|
}
|
|
} |