Exemplo n.º 1
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            this.Height                 = this.Settings.windowHeight;
            this.Width                  = this.Settings.windowWidth;
            this.Topmost                = this.Settings.onTop;
            this.OnTopMenu.IsChecked    = this.Settings.onTop;
            this.HotkeyToggle.IsChecked = this.Settings.hotkeysActive;

            // Prepare note renderer
            this.Renderer = new Parsing.Templater(this.Settings);

            this.RenderNotes(0);
            this.SetStatus("Connecting to Livesplit Server.");

            // Start networking thread
            this.closeThread   = false;
            this.networkThread = new Thread(new ThreadStart(this.ConnectLivesplit));
            this.networkThread.IsBackground = true;
            this.networkThread.Start();

            this.hotkeys = new HotkeyManager();

            if (this.Settings.hotkeysActive)
            {
                this.EnableHotkeys();
            }
        }
Exemplo n.º 2
0
        private void Settings_Click(object sender, RoutedEventArgs e)
        {
            var settingsWin = new SettingsWindow(this.hotkeys);

            // Disable hotkeys while the settings window is open
            this.DisableHotkeys();

            settingsWin.Topmost = this.Topmost;  // if this window is topmost, make settings topmost so it's not hidden.
            settingsWin.ShowDialog();

            // Enable hotkeys again
            if (this.Settings.hotkeysActive)
            {
                this.EnableHotkeys();
            }

            // Settings have been changed - refresh notes and connection
            if (this.CurrentNoteFile != null)
            {
                this.Notes = new Parsing.NoteManager(this.CurrentNoteFile, this.Settings);
            }

            this.Renderer = new Parsing.Templater(this.Settings);
            this.RenderNotes();
        }