Beispiel #1
0
        public void StartMonitorModeUI()
        {
            // dispose
            data = null;

            // init control properties
            autoToolStripMenuItem.Checked         = Properties.Settings.Default.autoImageToFileEnabled;
            startMonitorToolStripMenuItem.Visible = false;
            stopMonitorToolStripMenuItem.Visible  = true;

            // hide main window and display system tray icon
            dialogue.WindowState   = FormWindowState.Minimized;
            dialogue.ShowInTaskbar = false;
            dialogue.Hide();
            dialogue.notifyIcon.Visible = true;

            try
            {
                ModeController.RegisterHotKey(Properties.Settings.Default.pasteHotkey);
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message,
                                Resources.Strings.TitleError, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            ModeController.StartMonitorMode();
        }
Beispiel #2
0
        private bool TxtPasteHotkeyValidate(string hotkeyStr)
        {
            if (string.IsNullOrEmpty(hotkeyStr))
            {
                return(false);
            }

            try
            {
                ModeController.RegisterHotKey(hotkeyStr);
                return(true);
            }
            catch (Exception ex)
            {
                CommandLine.Warning("[Hotkey] register failed" + Environment.NewLine + ex.ToString());
                return(false);
            }
        }