private void UpdateRecentsList(string path) { if (string.IsNullOrEmpty(path)) { return; } int idx; if ((idx = RecentsList.IndexOf(path)) != -1) { RecentsList.RemoveAt(idx); } RecentsList.Insert(0, path); while (RecentsList.Count > 10) { RecentsList.RemoveAt(10); } }
private async void MainWindow_OnLoaded(object sender, RoutedEventArgs e) { if (Settings.Default.MRU_List != null) { foreach (var s in Settings.Default.MRU_List) { RecentsList.Add(s); } } if (Settings.Default.CheckUpdatesOnStartup) { bool hasUpdates = await Update.CheckUpdateAvailable(); if (hasUpdates) { MessageBox.Show(MainResources.Message_UpdateAvailable, WINDOW_TITLE, MessageBoxButton.OK, MessageBoxImage.Information); } } }
private void MainWindow_OnClosed(object sender, EventArgs e) { Settings.Default.MRU_List = RecentsList.ToArray(); }