diff options
author | yorah <yoram.harmelin@gmail.com> | 2012-11-21 21:09:29 +0400 |
---|---|---|
committer | yorah <yoram.harmelin@gmail.com> | 2012-11-23 15:51:51 +0400 |
commit | 1a45367cbd4013b8aa224956b47c8257ca370684 (patch) | |
tree | 53a577a9e933406920d9ffd3bcb5f0776eb02e8e /LibGit2Sharp/ConfigurationEntry.cs | |
parent | 247ca1a30cfb722b74ada4288bcca7293f59b87b (diff) |
Add some `DebuggerDisplay` love
I followed implementation best practices as described at http://blogs.msdn.com/b/jaredpar/archive/2011/03/18/debuggerdisplay-attribute-best-practices.aspx
Also added a Meta test to make sure the same implementation is used everywhere when using `[DebuggerDisplay]`.
Diffstat (limited to 'LibGit2Sharp/ConfigurationEntry.cs')
-rw-r--r-- | LibGit2Sharp/ConfigurationEntry.cs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/LibGit2Sharp/ConfigurationEntry.cs b/LibGit2Sharp/ConfigurationEntry.cs index af3a6b83..98edc921 100644 --- a/LibGit2Sharp/ConfigurationEntry.cs +++ b/LibGit2Sharp/ConfigurationEntry.cs @@ -1,8 +1,11 @@ -namespace LibGit2Sharp +using System.Diagnostics; + +namespace LibGit2Sharp { /// <summary> /// An enumerated configuration entry. /// </summary> + [DebuggerDisplay("{DebuggerDisplay,nq}")] public class ConfigurationEntry { /// <summary> @@ -33,5 +36,10 @@ Value = value; Level = level; } + + private string DebuggerDisplay + { + get { return string.Format("{0} = \"{1}\"", Key, Value); } + } } } |