v10.10.2024.0701 使用IJsonHost改进Json序列化
大石头 编写于 2024-07-01 08:36:34 大石头 提交于 2024-07-01 08:48:33
X
using System.Diagnostics;

namespace System.Collections.Generic;

internal sealed class CollectionDebuggerView<T>
{
	private readonly ICollection<T> c;

	[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
	public T[] Items
	{
		get
		{
			T[] array = new T[c.Count];
			c.CopyTo(array, 0);
			return array;
		}
	}

	public CollectionDebuggerView(ICollection<T> col)
	{
		c = col;
	}
}
internal sealed class CollectionDebuggerView<T, U>
{
	private readonly ICollection<KeyValuePair<T, U>> c;

	[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
	public KeyValuePair<T, U>[] Items
	{
		get
		{
			KeyValuePair<T, U>[] array = new KeyValuePair<T, U>[c.Count];
			c.CopyTo(array, 0);
			return array;
		}
	}

	public CollectionDebuggerView(ICollection<KeyValuePair<T, U>> col)
	{
		c = col;
	}
}