Files
Libation/Source/AudibleUtilities/AccountsSettingsPersister.cs
Michael Bucari-Tovo 3ab1edc076 Code Cleanup
Make fields readonly
Remove unnecessary casts
Format document
Remove unnecessary usings
Sort usings
Use file-level namespaces
Order modifiers
2026-02-05 12:48:44 -07:00

30 lines
1004 B
C#

using AudibleApi.Authorization;
using Dinah.Core.IO;
using Newtonsoft.Json;
using System;
namespace AudibleUtilities;
public class AccountsSettingsPersister : JsonFilePersister<AccountsSettings>
{
public static event EventHandler? Saving;
public static event EventHandler? Saved;
protected override void OnSaving() => Saving?.Invoke(null, EventArgs.Empty);
protected override void OnSaved() => Saved?.Invoke(null, EventArgs.Empty);
/// <summary>Alias for Target </summary>
public AccountsSettings AccountsSettings => Target;
/// <summary>uses path. create file if doesn't yet exist</summary>
public AccountsSettingsPersister(AccountsSettings target, string path, string? jsonPath = null)
: base(target, path, jsonPath) { }
/// <summary>load from existing file</summary>
public AccountsSettingsPersister(string path, string? jsonPath = null)
: base(path, jsonPath) { }
protected override JsonSerializerSettings GetSerializerSettings()
=> Identity.GetJsonSerializerSettings();
}