c# - Attribute that displays property value in Visual Studio -


i believe saw somewhere attribute that, when applied class, show value of property in intellisense. i'm not talking xml comments. looked this:

[someattribute("name = '{0}', age = '{1}'", name, age)] myclass 

anyone know attribute i'm talking about?

it doesn’t make sense “show value in intellisense”, guess mean in debugger. in case, attribute you’re looking debuggerdisplayattribute:

[debuggerdisplay("name = '{name}', age = '{age}'")] public class xyz {     public string name;     public int age; } 

of course, can override tostring() method instead. in absense of debuggerdisplayattribute, debugger uses tostring(). should use debuggerdisplayattribute if need implementation of tostring() different (and insufficient debugging).


Comments

Popular posts from this blog

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -

c++ - Warning : overflow in implicit constant conversion -