Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 3, 2023. It is now read-only.

Commit fe932f3

Browse files
committed
Add TransferProgress.DebuggerDisplay
1 parent c07261b commit fe932f3

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

LibGit2Sharp/TransferProgress.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
using LibGit2Sharp.Core;
1+
using System.Diagnostics;
2+
using System.Globalization;
3+
using LibGit2Sharp.Core;
24

35
namespace LibGit2Sharp
46
{
57
/// <summary>
68
/// Expose progress values from a fetch operation.
79
/// </summary>
10+
[DebuggerDisplay("{DebuggerDisplay,nq}")]
811
public class TransferProgress
912
{
1013
private GitTransferProgress gitTransferProgress;
@@ -66,5 +69,14 @@ public virtual long ReceivedBytes
6669
return (long) gitTransferProgress.received_bytes;
6770
}
6871
}
72+
73+
private string DebuggerDisplay
74+
{
75+
get
76+
{
77+
return string.Format(CultureInfo.InvariantCulture,
78+
"{0}/{1}, {2} bytes", ReceivedObjects, TotalObjects, ReceivedBytes);
79+
}
80+
}
6981
}
7082
}

0 commit comments

Comments
 (0)