Example #1
0
        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();
        }
Example #2
0
        private void OnStartup(object sender, StartupEventArgs ea)
        {
            InitializeSettings();
            Activated += OnActivated;

            var markdownConverter = new CommonMarkConverter();
            _spellingService = new SpellingService();
            var spellCheckProvider = new SpellCheckProvider(_spellingService);
            var snippetManager = new SnippetManager();
            var mainWindow = new MainWindow(markdownConverter, spellCheckProvider, snippetManager);
            var windowPlacementSettings = mainWindow.GetWindowPlacementSettings();

            if (windowPlacementSettings.UpgradeSettings)
            {
                windowPlacementSettings.Upgrade();
                windowPlacementSettings.UpgradeSettings = false;
                windowPlacementSettings.Save();
            }

            MainWindow = mainWindow;
            MainWindow.Show();
        }