Added changes to handle NETFX_CORE properly (I hope)

This commit is contained in:
Mark Taylor
2015-07-26 22:43:04 +01:00
parent e092a109ea
commit d5d264d05b
+11 -1
View File
@@ -10,8 +10,8 @@ namespace Octokit
{
#if !NETFX_CORE
[Serializable]
#endif
[DebuggerDisplay("{DebuggerDisplay,nq}")]
#endif
public class RateLimit
#if !NETFX_CORE
: ISerializable
@@ -52,14 +52,18 @@ namespace Octokit
/// <summary>
/// The date and time at which the current rate limit window resets
/// </summary>
#if !NETFX_CORE
[ParameterAttribute(Key = "ignoreThisField")]
#endif
public DateTimeOffset Reset { get; private set; }
/// <summary>
/// The date and time at which the current rate limit window resets - in UTC epoch seconds
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
#if !NETFX_CORE
[ParameterAttribute(Key = "reset")]
#endif
public long ResetAsUtcEpochSeconds { get { return Reset.ToUnixTime(); } private set { Reset = value.FromUnixTime(); } }
static long GetHeaderValueAsInt32Safe(IDictionary<string, string> responseHeaders, string key)
@@ -90,12 +94,18 @@ namespace Octokit
info.AddValue("Reset", Reset.Ticks);
}
#endif
#if !NETFX_CORE
internal string DebuggerDisplay
#else
public string DebuggerDisplay
#endif
{
get
{
return String.Format(CultureInfo.InvariantCulture, "Limit {0}, Remaining {1}, Reset {2} ", Limit, Remaining, Reset);
}
}
}
}