As an example, an object I've contrived that looks like this:
would be displayed in the debugger like this:
We can hide properties and fields from the debugger by decorating them with the attribute, initialised with "Never" - note the usage on a private field, which enforces the concept of encapsulation; a principle that from now on I'll be calling ASYPIP (Avoid showing your privates in public)
This object is displayed like this:
The last value of DebuggerBrowsableState is RootHidden - this does not show the property or field itself, but shows its child elements as direct descendants of the object. So, an object decorated like this...
... will be displayed like this:
.
No comments:
Post a Comment