示例#1
0
 public static void Save()
 {
     if (settings == null)
     {
         return;
     }
     settings.MusicProgress = MediaHelper.Position;
     JsonFileHelper.SaveAsync(JsonFilename, settings);
     JsonFileHelper.SaveAsync(Helper.TempFolder, JsonFilename + Helper.TimeStamp, settings);
 }
示例#2
0
        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;
        }