mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 03:30:34 +00:00
Added changes to handle NETFX_CORE properly (I hope)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user