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/Note.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/Note.cs')
-rw-r--r-- | LibGit2Sharp/Note.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/LibGit2Sharp/Note.cs b/LibGit2Sharp/Note.cs index 78621e39..1e7250ca 100644 --- a/LibGit2Sharp/Note.cs +++ b/LibGit2Sharp/Note.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using LibGit2Sharp.Core; using LibGit2Sharp.Core.Handles; @@ -7,6 +8,7 @@ namespace LibGit2Sharp /// <summary> /// A note, attached to a given <see cref = "GitObject"/>. /// </summary> + [DebuggerDisplay("{DebuggerDisplay,nq}")] public class Note : IEquatable<Note> { /// <summary> @@ -105,5 +107,14 @@ namespace LibGit2Sharp { return !Equals(left, right); } + + private string DebuggerDisplay + { + get + { + return string.Format("Target \"{0}\", Namespace \"{1}\": {2}", + TargetObjectId.ToString(7), Namespace, Message); + } + } } } |