// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
//
// EnumerableDebugView.cs
//
//
// Debugger type proxy for enumerables.
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Linq;
namespace System.Threading.Tasks.Dataflow.Internal
{
/// Debugger type proxy for an enumerable of T.
internal sealed class EnumerableDebugView
{
/// The enumerable being visualized.
private readonly IEnumerable> _enumerable;
/// Initializes the debug view.
/// The enumerable being debugged.
public EnumerableDebugView(IEnumerable> enumerable)
{
Contract.Requires(enumerable != null, "Expected a non-null enumerable.");
_enumerable = enumerable;
}
/// Gets the contents of the list.
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
public KeyValuePair[] Items { get { return _enumerable.ToArray(); } }
}
/// Debugger type proxy for an enumerable of T.
internal sealed class EnumerableDebugView
{
/// The enumerable being visualized.
private readonly IEnumerable _enumerable;
/// Initializes the debug view.
/// The enumerable being debugged.
public EnumerableDebugView(IEnumerable enumerable)
{
Contract.Requires(enumerable != null, "Expected a non-null enumerable.");
_enumerable = enumerable;
}
/// Gets the contents of the list.
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
public T[] Items { get { return _enumerable.ToArray(); } }
}
}