Overriding ToString for Easier Debugging(jeremyjarrell.com)

submitted by jeremyjarrelljeremyjarrell(2685) 4 years, 5 months ago

Did you know that you can override the ToString() method to make the debugger show you more information about your objects in the watch window. It's quick, it's easy, and it really works!

1 comment |category: |Views: 6

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by JudahGabrielJudahGabriel(783) 4 years, 5 months ago 0

You can also use the DebuggerDisplay attribute, which I find to be superior than ToString.

[DebuggerDisplay("Count = {Count}")]
class MyCollection
{
....
}

Reply

information Login or create an account to comment on this story