BililiveRecorder/BililiveRecorder.Flv/Amf/AmfDictionaryDebugView.cs
2021-02-08 16:51:19 +08:00

22 lines
718 B
C#

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace BililiveRecorder.Flv.Amf
{
internal sealed class AmfDictionaryDebugView
{
private readonly IDictionary<string, IScriptDataValue> _dict;
public AmfDictionaryDebugView(IDictionary<string, IScriptDataValue> dictionary)
{
this._dict = dictionary ?? throw new ArgumentNullException(nameof(dictionary));
}
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
public KeyValuePairDebugView<string, IScriptDataValue>[] Items
=> this._dict.Select(x => new KeyValuePairDebugView<string, IScriptDataValue>(x.Key, x.Value)).ToArray();
}
}