Debugger displays

This commit is contained in:
Amy Palamountain
2014-02-16 17:31:15 +13:00
parent c912825083
commit 1a78ed7ba7
9 changed files with 122 additions and 1 deletions
@@ -1,9 +1,13 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using Octokit.Helpers;
namespace Octokit
{
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class WeeklyCommitActivity
{
/// <summary>
@@ -21,6 +25,11 @@ namespace Octokit
/// </summary>
public long Week { get; set; }
public DateTimeOffset WeekTimestamp
{
get { return Week.FromUnixTime(); }
}
/// <summary>
/// Get the number of commits made on any <see cref="DayOfWeek"/>
/// </summary>
@@ -30,5 +39,14 @@ namespace Octokit
{
return Days.ElementAt((int)dayOfWeek);
}
internal string DebuggerDisplay
{
get
{
return String.Format(CultureInfo.InvariantCulture,
"Week: {0} Total Commits: {1}", WeekTimestamp, Total);
}
}
}
}