private void OnStartup(object sender, StartupEventArgs ea) { InitializeSettings(); if (UserSettings == null || AlreadyEditingFile()) { Shutdown(); return; } Activated += OnActivated; _spellingService = new SpellingService(); var spellCheckProvider = new SpellCheckProvider(_spellingService); var snippetManager = new SnippetManager(); var mainWindow = new MainWindow(spellCheckProvider, snippetManager); var windowPlacementSettings = mainWindow.GetWindowPlacementSettings(); if (windowPlacementSettings.UpgradeSettings) { windowPlacementSettings.Upgrade(); windowPlacementSettings.UpgradeSettings = false; windowPlacementSettings.Save(); } MainWindow = mainWindow; MainWindow.Show(); }
private void SetupTabSnippetHandler() { var editingKeyBindings = EditBox.TextArea.DefaultInputHandler.Editing.InputBindings.OfType <KeyBinding>(); var tabBinding = editingKeyBindings.Single(b => b.Key == Key.Tab && b.Modifiers == ModifierKeys.None); EditBox.TextArea.DefaultInputHandler.Editing.InputBindings.Remove(tabBinding); var newTabBinding = new KeyBinding(new SnippetTabCommand(EditBox, tabBinding.Command, SnippetManager), tabBinding.Key, tabBinding.Modifiers); EditBox.TextArea.DefaultInputHandler.Editing.InputBindings.Add(newTabBinding); SnippetManager.Initialize(); }
private void OnStartup(object sender, StartupEventArgs ea) { InitializeSettings(); Activated += OnActivated; var commonmarkConverter = new CommonMarkConverter(); var githubMarkdownConverter = new GitHubMarkdownConverter(); _spellingService = new SpellingService(); var spellCheckProvider = new SpellCheckProvider(_spellingService); var snippetManager = new SnippetManager(); var mainWindow = new MainWindow(commonmarkConverter, githubMarkdownConverter, spellCheckProvider, snippetManager); var windowPlacementSettings = mainWindow.GetWindowPlacementSettings(); if (windowPlacementSettings.UpgradeSettings) { windowPlacementSettings.Upgrade(); windowPlacementSettings.UpgradeSettings = false; windowPlacementSettings.Save(); } MainWindow = mainWindow; MainWindow.Show(); }