forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDictionaryProxy.cs
52 lines (46 loc) · 996 Bytes
/
DictionaryProxy.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
namespace NHibernate.DebugHelpers
{
/// <summary>
/// Used to show a better debug display for dictionaries
/// </summary>
public class DictionaryProxy
{
private readonly IDictionary set;
public DictionaryProxy(IDictionary dic)
{
this.set = dic;
}
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
public DictionaryEntry[] Items
{
get
{
DictionaryEntry[] entries = new DictionaryEntry[set.Count];
set.CopyTo(entries, 0);
return entries;
}
}
}
public class DictionaryProxy<K, V>
{
private readonly IDictionary<K, V> dic;
public DictionaryProxy(IDictionary<K, V> dic)
{
this.dic = dic;
}
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
public KeyValuePair<K, V>[] Items
{
get
{
KeyValuePair<K, V>[] entries = new KeyValuePair<K, V>[dic.Count];
dic.CopyTo(entries, 0);
return entries;
}
}
}
}