Files
Martin Barker 49ea2ba2a6 Added Support for Debug Logging
Updated a couple of variables for better memory use.
Added Support for ignoring specific streamers
Moved to using a SingletonFactory for Singlton Classes
No Longer Using MessageBox for disconnected message
Added better detection for disconnected to stop it poping with other problems
Added Window and menu option to open window to manage ignored streamers
2023-02-21 21:25:38 +00:00

44 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace TwitchDesktopNotifications.JsonStructure
{
public class Authentication
{
[JsonPropertyName("access_token")]
public string AccessToken { get; set; }
[JsonPropertyName("expires_in")]
public int ExpiresSeconds { get; set; }
[JsonPropertyName("refresh_token")]
public string RefreshToken { get; set; }
[JsonPropertyName("scope")]
public List<string> Scopes { get; set; }
[JsonPropertyName("token_type")]
public string TokenType { get; set; }
[JsonPropertyName("expiresAt")]
public long ExpiresAt { get; set; }
[JsonIgnore]
public DateTime ExpiresAsDate {
get
{
return (new DateTime(1970, 1, 1)).AddMilliseconds(ExpiresAt);
}
set
{
DateTime unixStart = DateTime.SpecifyKind(new DateTime(1970, 1, 1), DateTimeKind.Utc);
ExpiresAt = (long)Math.Floor((value.ToUniversalTime() - unixStart).TotalMilliseconds);
}
}
}
}