Skip to content

Commit cb2ea55

Browse files
authored
Add Dictionary<TKey, TValue> (#169)
1 parent c890525 commit cb2ea55

10 files changed

Lines changed: 1756 additions & 1 deletion

File tree

Tests/GenericCollections/DictionaryTests.cs

Lines changed: 432 additions & 0 deletions
Large diffs are not rendered by default.

Tests/GenericCollections/GenericCollections.nfproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.props" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.props')" />
2828
<ItemGroup>
2929
<Compile Include="CollectionTestBase.cs" />
30+
<Compile Include="DictionaryTests.cs" />
3031
<Compile Include="ListTests.cs" />
3132
<Compile Include="Properties\AssemblyInfo.cs" />
3233
</ItemGroup>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using System.Diagnostics;
5+
6+
namespace System.Collections.Generic
7+
{
8+
/// <summary>
9+
/// Defines a key/value pair for displaying an item of a dictionary by a debugger.
10+
/// </summary>
11+
[DebuggerDisplay("{Value}", Name = "[{Key}]")]
12+
internal readonly struct DebugViewDictionaryItem<TKey, TValue>
13+
{
14+
public DebugViewDictionaryItem(TKey key, TValue value)
15+
{
16+
Key = key;
17+
Value = value;
18+
}
19+
20+
public DebugViewDictionaryItem(KeyValuePair<TKey, TValue> keyValue)
21+
{
22+
Key = keyValue.Key;
23+
Value = keyValue.Value;
24+
}
25+
26+
[DebuggerBrowsable(DebuggerBrowsableState.Collapsed)]
27+
public TKey Key { get; }
28+
29+
[DebuggerBrowsable(DebuggerBrowsableState.Collapsed)]
30+
public TValue Value { get; }
31+
}
32+
}

0 commit comments

Comments
 (0)