예제 #1
0
파일: Library.cs 프로젝트: solwllms/CI536
        public static void SaveChanges()
        {
            if (collection == null)
            {
                return;
            }

            OnSaveChanges?.Invoke();

            string libraryPath = UserConfig.GetValue(CONFIG_FILE, "libary_path", defaultPath);

            JsonSerializerSettings settings = new JsonSerializerSettings();

            settings.NullValueHandling = NullValueHandling.Ignore;
            settings.ContractResolver  = new CamelCasePropertyNamesContractResolver();
            string json = JsonConvert.SerializeObject(collection, Formatting.Indented, settings);

            File.WriteAllText(libraryPath, json);

            UserConfig.SetValue(CONFIG_FILE, "recent", recent.ToArray());
        }
예제 #2
0
 private void GameContextMenu_HideHiddenGames(object sender, RoutedEventArgs e)
 {
     showHidden = false;
     UserConfig.SetValue(CONFIG_FILE, "show-hidden", showHidden);
     RefreshGamesList();
 }
예제 #3
0
파일: Library.cs 프로젝트: solwllms/CI536
 public static void AddToRecent(string title)
 {
     title = title.Trim().ToLower().ToSlug();
     recent.Enqueue(title);
     UserConfig.SetValue(CONFIG_FILE, "recent", recent.ToArray());
 }