Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryorah <yoram.harmelin@gmail.com>2012-11-21 21:09:29 +0400
committeryorah <yoram.harmelin@gmail.com>2012-11-23 15:51:51 +0400
commit1a45367cbd4013b8aa224956b47c8257ca370684 (patch)
tree53a577a9e933406920d9ffd3bcb5f0776eb02e8e /LibGit2Sharp/RemoteCollection.cs
parent247ca1a30cfb722b74ada4288bcca7293f59b87b (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/RemoteCollection.cs')
-rw-r--r--LibGit2Sharp/RemoteCollection.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/LibGit2Sharp/RemoteCollection.cs b/LibGit2Sharp/RemoteCollection.cs
index 523c63c4..91fb88dd 100644
--- a/LibGit2Sharp/RemoteCollection.cs
+++ b/LibGit2Sharp/RemoteCollection.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using LibGit2Sharp.Core;
using LibGit2Sharp.Core.Handles;
@@ -10,6 +11,7 @@ namespace LibGit2Sharp
/// <summary>
/// The collection of <see cref = "Remote" /> in a <see cref = "Repository" />
/// </summary>
+ [DebuggerDisplay("{DebuggerDisplay,nq}")]
public class RemoteCollection : IEnumerable<Remote>
{
private readonly Repository repository;
@@ -131,5 +133,10 @@ namespace LibGit2Sharp
{
return Add(name, url);
}
+
+ private string DebuggerDisplay
+ {
+ get { return string.Format("Count = {0}", this.Count()); }
+ }
}
}