private void LogTabWindow_Load(object sender, EventArgs e) { ApplySettings(ConfigManager.Settings, SettingsFlags.All); if (ConfigManager.Settings.isMaximized) { if (ConfigManager.Settings.appBoundsFullscreen != null) { Bounds = ConfigManager.Settings.appBoundsFullscreen; } WindowState = FormWindowState.Maximized; Bounds = ConfigManager.Settings.appBounds; } else { if (ConfigManager.Settings.appBounds != null && ConfigManager.Settings.appBounds.Right > 0) { Bounds = ConfigManager.Settings.appBounds; } } if (ConfigManager.Settings.preferences.openLastFiles && startupFileNames == null) { List <string> tmpList = ObjectClone.Clone <List <string> >(ConfigManager.Settings.lastOpenFilesList); foreach (string name in tmpList) { if (name != null && name.Length > 0) { AddFileTab(name, false, null, false, null); } } } if (startupFileNames != null) { LoadFiles(startupFileNames, false); } ledThread = new Thread(LedThreadProc); ledThread.IsBackground = true; ledThread.Start(); statusLineThread = new Thread(StatusLineThreadFunc); statusLineThread.IsBackground = true; statusLineThread.Start(); FillHighlightComboBox(); FillToolLauncherBar(); #if !DEBUG debugToolStripMenuItem.Visible = false; #endif }
/// <summary> /// Imports all or some of the settings/prefs stored in the inpute stream. /// This will overwrite appropriate parts of the current (own) settings with the imported ones. /// </summary> /// <param name="fs"></param> /// <param name="flags">Flags to indicate which parts shall be imported</param> private Settings Import(Settings currentSettings, Stream fs, ExportImportFlags flags) { Settings importSettings = LoadOrCreateNew(fs); Settings ownSettings = ObjectClone.Clone(currentSettings); Settings newSettings; // at first check for 'Other' as this are the most options. if ((flags & ExportImportFlags.Other) == ExportImportFlags.Other) { newSettings = ownSettings; newSettings.preferences = ObjectClone.Clone(importSettings.preferences); newSettings.preferences.columnizerMaskList = ownSettings.preferences.columnizerMaskList; newSettings.preferences.highlightMaskList = ownSettings.preferences.highlightMaskList; newSettings.hilightGroupList = ownSettings.hilightGroupList; newSettings.preferences.toolEntries = ownSettings.preferences.toolEntries; } else { newSettings = ownSettings; } if ((flags & ExportImportFlags.ColumnizerMasks) == ExportImportFlags.ColumnizerMasks) { newSettings.preferences.columnizerMaskList = importSettings.preferences.columnizerMaskList; } if ((flags & ExportImportFlags.HighlightMasks) == ExportImportFlags.HighlightMasks) { newSettings.preferences.highlightMaskList = importSettings.preferences.highlightMaskList; } if ((flags & ExportImportFlags.HighlightSettings) == ExportImportFlags.HighlightSettings) { newSettings.hilightGroupList = importSettings.hilightGroupList; } if ((flags & ExportImportFlags.ToolEntries) == ExportImportFlags.ToolEntries) { newSettings.preferences.toolEntries = importSettings.preferences.toolEntries; } return(newSettings); }