Reputation: 2562
I am trying to do something like this on an indexer class:
[DebuggerDisplay("Debug: {_Items[index]}")]
public override string this[byte index]
However, when the debugger evaluates the string, the message in the value field is "index does not exist in the current context".
Is there some way to use the DebuggerDisplay attribute to control the display of a single element within an indexer class??
Upvotes: 1
Views: 1183
Reputation: 99869
Edit: I really am not confident of the OP's question. This is how you can get a collection type to show its members as a list in the debugger.
Place the following attribute on a field or property that is "an array or collection", perhaps it checks for an implementation of IList<T>
?
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
Upvotes: 1