本文整理匯總了C#中System.Diagnostics.DebuggerTypeProxyAttribute類的典型用法代碼示例。如果您正苦於以下問題:C# DebuggerTypeProxyAttribute類的具體用法?C# DebuggerTypeProxyAttribute怎麽用?C# DebuggerTypeProxyAttribute使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DebuggerTypeProxyAttribute類屬於System.Diagnostics命名空間,在下文中一共展示了DebuggerTypeProxyAttribute類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: HashtableDebugView
[DebuggerTypeProxy(typeof(HashtableDebugView))]
class MyHashtable : Hashtable
{
private const string TestString = "This should not appear in the debug window.";
internal class HashtableDebugView
{
private Hashtable hashtable;
public const string TestString = "This should appear in the debug window.";
public HashtableDebugView(Hashtable hashtable)
{
this.hashtable = hashtable;
}
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
public KeyValuePairs[] Keys
{
get
{
KeyValuePairs[] keys = new KeyValuePairs[hashtable.Count];
int i = 0;
foreach(object key in hashtable.Keys)
{
keys[i] = new KeyValuePairs(hashtable, key, hashtable[key]);
i++;
}
return keys;
}
}
}
}