Ejemplo n.º 1
0
        /// <summary>
        /// Handles the pause resume button click event.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">Event arguments.</param>
        private void OnPauseResumeButtonClick(object sender, EventArgs e)
        {
            // Check if must pause
            if (this.pauseResumeButton.Text.StartsWith("&P", StringComparison.InvariantCulture))
            {
                // Disable keyboard hook
                KeyboardHook.DisableHook();

                // Update monitor status
                this.hotkeyGroupBox.Text = "Hotkey is: INACTIVE";

                // Set button text
                this.pauseResumeButton.Text = "&Resume";
            }
            else
            {
                // Enable keyboard hook
                KeyboardHook.EnableHook();

                // Update monitor status
                this.hotkeyGroupBox.Text = "Hotkey is: ACTIVE";

                // Set button text
                this.pauseResumeButton.Text = "&Pause";
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Handles the main form form closing event.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">Event arguments.</param>
        private void OnMainFormFormClosing(object sender, FormClosingEventArgs e)
        {
            // Remove hook
            KeyboardHook.DisableHook();

            // Set run at startup
            this.settingsData.RunAtStartup = this.runAtStartupToolStripMenuItem.Checked;

            // Process registry action
            this.ProcessRunAtStartupRegistry();

            // Set hide close button
            this.settingsData.HideCloseButton = this.hideCloseButtonToolStripMenuItem.Checked;

            // Set do not open image
            this.settingsData.DoNotOpenImage = this.doNotopenImageToolStripMenuItem.Checked;

            // Set save image directory
            this.settingsData.SaveImageDirectory = this.directoryTextBox.Text;

            // Save settings to disk
            this.SaveSettingsData();
        }