/// <summary> /// New Instance of the Halo Map Location /// </summary> /// <param name="cacheLocation"></param> /// <param name="tab"></param> /// <param name="tagSorting"> </param> public HaloMap(string cacheLocation, LayoutDocument tab, Settings.TagSort tagSorting) { InitializeComponent(); AddHandler(CloseableTabItem.CloseTabEvent, new RoutedEventHandler(CloseTab)); // Setup Context Menus InitalizeContextMenus(); _tab = tab; _tagSorting = tagSorting; _cacheLocation = cacheLocation; // Update dockpanel location UpdateDockPanelLocation(); // Show UI Pending Stuff doingAction.Visibility = Visibility.Visible; tabScripts.Visibility = Visibility.Collapsed; // Read Settings cbShowEmptyTags.IsChecked = App.AssemblyStorage.AssemblySettings.HalomapShowEmptyClasses; cbShowBookmarkedTagsOnly.IsChecked = App.AssemblyStorage.AssemblySettings.HalomapOnlyShowBookmarkedTags; cbTabOpenMode.SelectedIndex = (int) App.AssemblyStorage.AssemblySettings.HalomapTagOpenMode; App.AssemblyStorage.AssemblySettings.PropertyChanged += SettingsChanged; var initalLoadBackgroundWorker = new BackgroundWorker(); initalLoadBackgroundWorker.DoWork += initalLoadBackgroundWorker_DoWork; initalLoadBackgroundWorker.RunWorkerCompleted += BackgroundWorker_RunWorkerCompleted; initalLoadBackgroundWorker.RunWorkerAsync(); }
public static void AddNewEntry(string filename, string filepath, string game, Settings.RecentFileType type) { Settings.RecentFileEntry alreadyExistsEntry = null; if (Settings.applicationRecents == null) Settings.applicationRecents = new List<Settings.RecentFileEntry>(); foreach (var entry in Settings.applicationRecents.Where(entry => entry.FileName == filename && entry.FilePath == filepath && entry.FileGame == game)) alreadyExistsEntry = entry; if (alreadyExistsEntry == null) { // Add New Entry var newEntry = new Settings.RecentFileEntry { FileGame = game, FileName = filename, FilePath = filepath, FileType = type }; Settings.applicationRecents.Insert(0, newEntry); } else { // Move existing Entry Settings.applicationRecents.Remove(alreadyExistsEntry); Settings.applicationRecents.Insert(0, alreadyExistsEntry); } Settings.UpdateSettings(); JumpLists.UpdateJumplists(); }
/// <summary> /// Gets the name of the branch corresponding to an update source. /// </summary> /// <param name="source">The source.</param> /// <returns>The branch name.</returns> public static string GetBranchName(Settings.UpdateSource source) { switch (source) { case Settings.UpdateSource.Stable: return StableBranchName; case Settings.UpdateSource.Experimental: return ExperimentalBranchName; default: throw new ArgumentException("Unrecognized update source: " + source); } }
public static void RemoveEntry(Settings.RecentFileEntry entry) { Settings.applicationRecents.Remove(entry); Settings.UpdateSettings(); }
/// <summary> /// New Instance of the Halo Map Location /// </summary> /// <param name="cacheLocation"></param> /// <param name="tab"></param> /// <param name="tagSorting"> </param> public HaloMap(string cacheLocation, TabItem tab, Settings.TagSort tagSorting) { InitializeComponent(); AddHandler(CloseableTabItem.CloseTabEvent, new RoutedEventHandler(CloseTab)); // Setup Context Menus InitalizeContextMenus(); _tab = tab; _tagSorting = tagSorting; _cacheLocation = cacheLocation; // Update dockpanel location UpdateDockPanelLocation(); // Show UI Pending Stuff doingAction.Visibility = Visibility.Visible; tabScripts.Visibility = Visibility.Collapsed; // Read Settings cbShowEmptyTags.IsChecked = Settings.halomapShowEmptyClasses; Settings.SettingsChanged += SettingsChanged; var initalLoadBackgroundWorker = new BackgroundWorker(); initalLoadBackgroundWorker.DoWork += initalLoadBackgroundWorker_DoWork; initalLoadBackgroundWorker.RunWorkerCompleted += BackgroundWorker_RunWorkerCompleted; initalLoadBackgroundWorker.RunWorkerAsync(); }