public static BlazorOBSTwitchSettings Get() { var settingsPath = BlazorOBSAppDataDirectory.GetFilePath("serverSettings.json", true); var json = File.ReadAllText(settingsPath); return(JsonConvert.DeserializeObject <BlazorOBSTwitchSettings>(json)); }
public static BlazorOBSUserSettings Get() { var path = BlazorOBSAppDataDirectory.GetFilePath("usersettings.json"); if (File.Exists(path) == false) { return(null); } var json = File.ReadAllText(path); return(JsonConvert.DeserializeObject <BlazorOBSUserSettings>(json)); }
public static void Save(string accessToken, string idToken, string scope, string tokenType) { var settings = new BlazorOBSUserSettings { AccessToken = accessToken, IdToken = idToken, Scope = scope, TokenType = tokenType }; var path = BlazorOBSAppDataDirectory.GetFilePath("usersettings.json"); var json = JsonConvert.SerializeObject(settings); File.WriteAllText(path, json); }