<Compile Include="$(BclSourcesRoot)\System\Collections\Generic\ComparerHelpers.cs" />
<Compile Include="$(BclSourcesRoot)\System\Collections\Generic\Dictionary.cs" />
<Compile Include="$(BclSourcesRoot)\System\Collections\Generic\EqualityComparer.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Collections\Generic\DebugView.cs" />
<Compile Include="$(BclSourcesRoot)\System\Collections\Generic\ArraySortHelper.cs" />
<Compile Include="$(BclSourcesRoot)\System\Collections\ObjectModel\ReadOnlyDictionary.cs" />
<Compile Include="$(BclSourcesRoot)\System\Collections\Concurrent\ConcurrentStack.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\CLSCompliantAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Collections\DictionaryEntry.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Collections\Generic\ICollection.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)System\Collections\Generic\ICollectionDebugView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Collections\Generic\IComparer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Collections\Generic\IDictionary.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)System\Collections\Generic\IDictionaryDebugView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Collections\Generic\IEnumerable.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Collections\Generic\IEnumerator.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Collections\Generic\IEqualityComparer.cs" />
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Diagnostics;
+
+namespace System.Collections.Generic
+{
+ internal sealed class ICollectionDebugView<T>
+ {
+ private readonly ICollection<T> _collection;
+
+ public ICollectionDebugView(ICollection<T> collection)
+ {
+ if (collection == null)
+ {
+ throw new ArgumentNullException(nameof(collection));
+ }
+
+ _collection = collection;
+ }
+
+ [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
+ public T[] Items
+ {
+ get
+ {
+ T[] items = new T[_collection.Count];
+ _collection.CopyTo(items, 0);
+ return items;
+ }
+ }
+ }
+}
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Diagnostics;
+
+namespace System.Collections.Generic
+{
+ internal sealed class IDictionaryDebugView<K, V>
+ {
+ private readonly IDictionary<K, V> _dict;
+
+ public IDictionaryDebugView(IDictionary<K, V> dictionary)
+ {
+ if (dictionary == null)
+ throw new ArgumentNullException(nameof(dictionary));
+
+ _dict = dictionary;
+ }
+
+ [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
+ public KeyValuePair<K, V>[] Items
+ {
+ get
+ {
+ KeyValuePair<K, V>[] items = new KeyValuePair<K, V>[_dict.Count];
+ _dict.CopyTo(items, 0);
+ return items;
+ }
+ }
+ }
+
+ internal sealed class DictionaryKeyCollectionDebugView<TKey, TValue>
+ {
+ private readonly ICollection<TKey> _collection;
+
+ public DictionaryKeyCollectionDebugView(ICollection<TKey> collection)
+ {
+ if (collection == null)
+ throw new ArgumentNullException(nameof(collection));
+
+ _collection = collection;
+ }
+
+ [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
+ public TKey[] Items
+ {
+ get
+ {
+ TKey[] items = new TKey[_collection.Count];
+ _collection.CopyTo(items, 0);
+ return items;
+ }
+ }
+ }
+
+ internal sealed class DictionaryValueCollectionDebugView<TKey, TValue>
+ {
+ private readonly ICollection<TValue> _collection;
+
+ public DictionaryValueCollectionDebugView(ICollection<TValue> collection)
+ {
+ if (collection == null)
+ throw new ArgumentNullException(nameof(collection));
+
+ _collection = collection;
+ }
+
+ [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
+ public TValue[] Items
+ {
+ get
+ {
+ TValue[] items = new TValue[_collection.Count];
+ _collection.CopyTo(items, 0);
+ return items;
+ }
+ }
+ }
+}
// of the List is automatically increased as required by reallocating the
// internal array.
//
- [DebuggerTypeProxy(typeof(Mscorlib_CollectionDebugView<>))]
+ [DebuggerTypeProxy(typeof(ICollectionDebugView<>))]
[DebuggerDisplay("Count = {Count}")]
[Serializable]
[System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
namespace System.Collections.ObjectModel
{
[Serializable]
- [DebuggerTypeProxy(typeof(Mscorlib_CollectionDebugView<>))]
+ [DebuggerTypeProxy(typeof(ICollectionDebugView<>))]
[DebuggerDisplay("Count = {Count}")]
[System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public class Collection<T> : IList<T>, IList, IReadOnlyList<T>
namespace System.Collections.ObjectModel
{
[Serializable]
- [DebuggerTypeProxy(typeof(Mscorlib_CollectionDebugView<>))]
+ [DebuggerTypeProxy(typeof(ICollectionDebugView<>))]
[DebuggerDisplay("Count = {Count}")]
[System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public class ReadOnlyCollection<T> : IList<T>, IList, IReadOnlyList<T>
/// using parameters to the type's constructors.
/// </para>
/// </remarks>
- [DebuggerTypeProxy(typeof(System_LazyDebugView<>))]
+ [DebuggerTypeProxy(typeof(LazyDebugView<>))]
[DebuggerDisplay("ThreadSafetyMode={Mode}, IsValueCreated={IsValueCreated}, IsValueFaulted={IsValueFaulted}, Value={ValueForDebugDisplay}")]
public class Lazy<T>
{
/// <summary>A debugger view of the Lazy<T> to surface additional debugging properties and
/// to ensure that the Lazy<T> does not become initialized if it was not already.</summary>
- internal sealed class System_LazyDebugView<T>
+ internal sealed class LazyDebugView<T>
{
//The Lazy object being viewed.
private readonly Lazy<T> _lazy;
/// <summary>Constructs a new debugger view object for the provided Lazy object.</summary>
/// <param name="lazy">A Lazy object to browse in the debugger.</param>
- public System_LazyDebugView(Lazy<T> lazy)
+ public LazyDebugView(Lazy<T> lazy)
{
_lazy = lazy;
}
/// All public and protected members of <see cref="ConcurrentDictionary{TKey,TValue}"/> are thread-safe and may be used
/// concurrently from multiple threads.
/// </remarks>
- [DebuggerTypeProxy(typeof(Mscorlib_DictionaryDebugView<,>))]
+ [DebuggerTypeProxy(typeof(IDictionaryDebugView<,>))]
[DebuggerDisplay("Count = {Count}")]
internal class ConcurrentDictionary<TKey, TValue> : IDictionary<TKey, TValue>, IDictionary, IReadOnlyDictionary<TKey, TValue>
{
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================================
-**
-**
-**
-** Purpose: DebugView class for generic collections
-**
-**
-**
-**
-=============================================================================*/
-
-using System;
-using System.Collections.ObjectModel;
-using System.Diagnostics;
-using System.Diagnostics.Contracts;
-
-namespace System.Collections.Generic
-{
- //
- // VS IDE can't differentiate between types with the same name from different
- // assembly. So we need to use different names for collection debug view for
- // collections in mscorlib.dll and system.dll.
- //
- internal sealed class Mscorlib_CollectionDebugView<T>
- {
- private ICollection<T> collection;
-
- public Mscorlib_CollectionDebugView(ICollection<T> collection)
- {
- if (collection == null)
- ThrowHelper.ThrowArgumentNullException(ExceptionArgument.collection);
-
- this.collection = collection;
- }
-
- [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
- public T[] Items
- {
- get
- {
- T[] items = new T[collection.Count];
- collection.CopyTo(items, 0);
- return items;
- }
- }
- }
-
- internal sealed class Mscorlib_DictionaryKeyCollectionDebugView<TKey, TValue>
- {
- private ICollection<TKey> collection;
-
- public Mscorlib_DictionaryKeyCollectionDebugView(ICollection<TKey> collection)
- {
- if (collection == null)
- ThrowHelper.ThrowArgumentNullException(ExceptionArgument.collection);
-
- this.collection = collection;
- }
-
- [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
- public TKey[] Items
- {
- get
- {
- TKey[] items = new TKey[collection.Count];
- collection.CopyTo(items, 0);
- return items;
- }
- }
- }
-
- internal sealed class Mscorlib_DictionaryValueCollectionDebugView<TKey, TValue>
- {
- private ICollection<TValue> collection;
-
- public Mscorlib_DictionaryValueCollectionDebugView(ICollection<TValue> collection)
- {
- if (collection == null)
- ThrowHelper.ThrowArgumentNullException(ExceptionArgument.collection);
-
- this.collection = collection;
- }
-
- [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
- public TValue[] Items
- {
- get
- {
- TValue[] items = new TValue[collection.Count];
- collection.CopyTo(items, 0);
- return items;
- }
- }
- }
-
- internal sealed class Mscorlib_DictionaryDebugView<K, V>
- {
- private IDictionary<K, V> dict;
-
- public Mscorlib_DictionaryDebugView(IDictionary<K, V> dictionary)
- {
- if (dictionary == null)
- ThrowHelper.ThrowArgumentNullException(ExceptionArgument.dictionary);
-
- dict = dictionary;
- }
-
- [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
- public KeyValuePair<K, V>[] Items
- {
- get
- {
- KeyValuePair<K, V>[] items = new KeyValuePair<K, V>[dict.Count];
- dict.CopyTo(items, 0);
- return items;
- }
- }
- }
-
-}
ThrowOnExisting = 2
}
- [DebuggerTypeProxy(typeof(Mscorlib_DictionaryDebugView<,>))]
+ [DebuggerTypeProxy(typeof(IDictionaryDebugView<,>))]
[DebuggerDisplay("Count = {Count}")]
[Serializable]
[System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
}
}
- [DebuggerTypeProxy(typeof(Mscorlib_DictionaryKeyCollectionDebugView<,>))]
+ [DebuggerTypeProxy(typeof(DictionaryKeyCollectionDebugView<,>))]
[DebuggerDisplay("Count = {Count}")]
public sealed class KeyCollection : ICollection<TKey>, ICollection, IReadOnlyCollection<TKey>
{
}
}
- [DebuggerTypeProxy(typeof(Mscorlib_DictionaryValueCollectionDebugView<,>))]
+ [DebuggerTypeProxy(typeof(DictionaryValueCollectionDebugView<,>))]
[DebuggerDisplay("Count = {Count}")]
public sealed class ValueCollection : ICollection<TValue>, ICollection, IReadOnlyCollection<TValue>
{
namespace System.Collections.ObjectModel
{
- [DebuggerTypeProxy(typeof(Mscorlib_DictionaryDebugView<,>))]
+ [DebuggerTypeProxy(typeof(IDictionaryDebugView<,>))]
[DebuggerDisplay("Count = {Count}")]
internal class ReadOnlyDictionary<TKey, TValue> : IDictionary<TKey, TValue>, IDictionary, IReadOnlyDictionary<TKey, TValue>
{
#endregion IReadOnlyDictionary members
- [DebuggerTypeProxy(typeof(Mscorlib_CollectionDebugView<>))]
+ [DebuggerTypeProxy(typeof(ICollectionDebugView<>))]
[DebuggerDisplay("Count = {Count}")]
public sealed class KeyCollection : ICollection<TKey>, ICollection, IReadOnlyCollection<TKey>
{
#endregion
}
- [DebuggerTypeProxy(typeof(Mscorlib_CollectionDebugView<>))]
+ [DebuggerTypeProxy(typeof(ICollectionDebugView<>))]
[DebuggerDisplay("Count = {Count}")]
public sealed class ValueCollection : ICollection<TValue>, ICollection, IReadOnlyCollection<TValue>
{