public static void HotkeysUpdate()
 {
     HotkeyMgrs.Clear();
     foreach (Workflow wf in Program.ConfigWorkflow.Workflows98)
     {
         HotkeyManager hm = new HotkeyManager(Program.CoreUI, ZAppType.JBird);
         hm.AddHotkey(JBirdHotkey.Workflow, wf.Hotkey, wf.Start);
         HotkeyMgrs.Add(wf.ID, hm);
     }
 }
        public JBirdWorkflowWizard(WorkerTask task = null, Workflow workflow = null, WorkflowWizardGUIOptions gui = null)
        {
            base.InitializeComponent();
            InitializeComponent();
            base.Initialize(task, gui);

            HotkeyManager tempHotkeyMgr;
            this.Task = new WorkerTask(workflow);
            this.Config = workflow;
            Program.HotkeyMgrs.TryGetValue(this.Config.ID, out tempHotkeyMgr);
            if (tempHotkeyMgr != null)
            {
                hmcHotkeys.PrepareHotkeys(tempHotkeyMgr);
            }
            else
            {
                HotkeyManager hm = new HotkeyManager(Program.CoreUI, ZAppType.JBird);
                hm.AddHotkey(JBirdHotkey.Workflow, Config.Hotkey, Config.Start);
                hmcHotkeys.PrepareHotkeys(hm);
            }
        }
        private void InitHotkeys()
        {
            HotkeyManager = new HotkeyManager(this, ZAppType.ZUploader);
            HotkeyManager.AddHotkey(ZUploaderHotkey.ClipboardUpload, Program.Settings.HotkeyClipboardUpload, UploadManager.ClipboardUpload);
            HotkeyManager.AddHotkey(ZUploaderHotkey.FileUpload, Program.Settings.HotkeyFileUpload, UploadManager.UploadFile);
            HotkeyManager.AddHotkey(ZUploaderHotkey.PrintScreen, Program.Settings.HotkeyPrintScreen, () => CaptureScreen(false), tsmiFullscreen);
            HotkeyManager.AddHotkey(ZUploaderHotkey.ActiveWindow, Program.Settings.HotkeyActiveWindow, () => CaptureActiveWindow(false));
            HotkeyManager.AddHotkey(ZUploaderHotkey.ActiveMonitor, Program.Settings.HotkeyActiveMonitor, () => CaptureActiveMonitor(false));
            HotkeyManager.AddHotkey(ZUploaderHotkey.WindowRectangle, Program.Settings.HotkeyWindowRectangle, () => WindowRectangleCapture(false), tsmiWindowRectangle);
            HotkeyManager.AddHotkey(ZUploaderHotkey.RectangleRegion, Program.Settings.HotkeyRectangleRegion,
                () => CaptureRegion(new RectangleRegion(), false), tsmiRectangle);
            HotkeyManager.AddHotkey(ZUploaderHotkey.RoundedRectangleRegion, Program.Settings.HotkeyRoundedRectangleRegion,
                () => CaptureRegion(new RoundedRectangleRegion(), false), tsmiRoundedRectangle);
            HotkeyManager.AddHotkey(ZUploaderHotkey.EllipseRegion, Program.Settings.HotkeyEllipseRegion,
                () => CaptureRegion(new EllipseRegion(), false), tsmiEllipse);
            HotkeyManager.AddHotkey(ZUploaderHotkey.TriangleRegion, Program.Settings.HotkeyTriangleRegion,
                () => CaptureRegion(new TriangleRegion(), false), tsmiTriangle);
            HotkeyManager.AddHotkey(ZUploaderHotkey.DiamondRegion, Program.Settings.HotkeyDiamondRegion,
                () => CaptureRegion(new DiamondRegion(), false), tsmiDiamond);
            HotkeyManager.AddHotkey(ZUploaderHotkey.PolygonRegion, Program.Settings.HotkeyPolygonRegion,
                () => CaptureRegion(new PolygonRegion(), false), tsmiPolygon);
            HotkeyManager.AddHotkey(ZUploaderHotkey.FreeHandRegion, Program.Settings.HotkeyFreeHandRegion,
                () => CaptureRegion(new FreeHandRegion(), false), tsmiFreeHand);

            string failedHotkeys;

            if (HotkeyManager.IsHotkeyRegisterFailed(out failedHotkeys))
            {
                MessageBox.Show("Unable to register hotkey(s):\r\n\r\n" + failedHotkeys +
                    "\r\n\r\nPlease select a different hotkey or quit the conflicting application and reopen ZUploader.",
                    "Hotkey register failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
        private void InitHotkeys()
        {
            if (HotkeyManager == null)
            {
                HotkeyManager = new HotkeyManager(this, ZAppType.ZScreen);

                HotkeyManager.AddHotkey(ZScreenHotkey.EntireScreen, Engine.ConfigUI.HotkeyEntireScreen2, CaptureEntireScreen);
                HotkeyManager.AddHotkey(ZScreenHotkey.ActiveMonitor, Engine.ConfigUI.HotkeyActiveMonitor2, CaptureActiveMonitor);
                HotkeyManager.AddHotkey(ZScreenHotkey.ActiveWindow, Engine.ConfigUI.HotkeyActiveWindow2, CaptureActiveWindow);
                HotkeyManager.AddHotkey(ZScreenHotkey.RectangleRegion, Engine.ConfigUI.HotkeyRectangleRegion2, CaptureRectRegion);

                HotkeyManager.AddHotkey(ZScreenHotkey.RectangleRegionLast, Engine.ConfigUI.HotkeyRectangleRegionLast2, CaptureRectRegionLast);
                HotkeyManager.AddHotkey(ZScreenHotkey.SelectedWindow, Engine.ConfigUI.HotkeySelectedWindow2, CaptureSelectedWindow);
                HotkeyManager.AddHotkey(ZScreenHotkey.FreehandRegion, Engine.ConfigUI.HotkeyFreeHandRegion2, CaptureFreeHandRegion);

                HotkeyManager.AddHotkey(ZScreenHotkey.ClipboardUpload, Engine.ConfigUI.HotkeyClipboardUpload2, UploadUsingClipboardOrGoogleTranslate);
                HotkeyManager.AddHotkey(ZScreenHotkey.AutoCapture, Engine.ConfigUI.HotkeyAutoCapture2, ShowAutoCapture);
                HotkeyManager.AddHotkey(ZScreenHotkey.DropWindow, Engine.ConfigUI.HotkeyDropWindow2, ShowDropWindow);

                HotkeyManager.AddHotkey(ZScreenHotkey.ScreenColorPicker, Engine.ConfigUI.HotkeyScreenColorPicker2, ShowScreenColorPicker);
                HotkeyManager.AddHotkey(ZScreenHotkey.TwitterClient, Engine.ConfigUI.HotkeyTwitterClient2, Adapter.ShowTwitterClient);
                HotkeyManager.AddHotkey(ZScreenHotkey.RectangleRegionClipboard, Engine.ConfigUI.HotkeyCaptureRectangeRegionClipboard2, CaptureRectRegionClipboard);

                string failedHotkeys;

                if (HotkeyManager.IsHotkeyRegisterFailed(out failedHotkeys))
                {
                    MessageBox.Show(string.Format("Unable to register hotkey(s):\r\n\r\n" + failedHotkeys +
                        "\r\n\r\nPlease select a different hotkey or quit the conflicting application and reopen {0}.", Application.ProductName),
                        "Hotkey register failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }