public static void Save() { if (settings == null) { return; } settings.MusicProgress = MediaHelper.Position; JsonFileHelper.SaveAsync(JsonFilename, settings); JsonFileHelper.SaveAsync(Helper.TempFolder, JsonFilename + Helper.TimeStamp, settings); }
public static async Task Init() { Inited = false; var json = await JsonFileHelper.ReadAsync(JsonFilename); if (string.IsNullOrEmpty(json)) { settings = new Settings(); Save(); } else { settings = JsonFileHelper.Convert <Settings>(json); await Init(settings); } Inited = true; }