Having two classes:
[DebuggerDisplay(@"One = {One}, two = {Two}")]
public class A
{
public int One { get; set; }
public B
Copied possible solution from OP
Probably, my requirement is not possible as per this SO answer. Maybe a good solution would be to override ToString in class B and do some if..else and use the Debugger.IsAttached property to behave different only inside the debugger.
Something like:
[DebuggerDisplay(@"Three = {Three}")]
public class B
{
public int Three { get; set; }
public override string ToString()
{
if (Debugger.IsAttached)
{
return string.Format(@"Three = {0}", Three);
}
else
{
return base.ToString();
}
}
}