public HotkeySelectionControl(Workflow wf)
 {
     InitializeComponent();
     Workflow = wf;
     chkHotkeyDescription.Text = Workflow.HotkeyConfig.Description;
     btnSetHotkey.Text = new KeyInfo(Workflow.HotkeyConfig.Hotkey).ToString();
     if (!this.Workflow.HotkeyConfig.SystemHotkey)
         this.set_HotkeyFontBold();
     UpdateHotkeyStatus();
 }
Exemplo n.º 2
0
        public WorkflowManager(HotkeyManager hm, Workflow wf)
        {
            _HotkeyManager = hm;
            _Workflow = wf;

            InitializeComponent();
            this.Text = Application.ProductName + " - Workflows";

            PrepareWorkflows();
        }
Exemplo n.º 3
0
        public WindowWorkflow(Workflow wf)
        {
            Workflow = wf;
            wf.Settings.GetDefaults();

            InitializeComponent();

            IntPtr h = tcWorkflow.Handle; // bug in .net maybe: The TabControl's handle must be created for the Insert method to work. 
            OnLoad();
        }
Exemplo n.º 4
0
        public void AddHotkey(Workflow wf, Action action, ToolStripMenuItem menuItem = null)
        {
            wf.HotkeyConfig.Action = action;
            wf.HotkeyConfig.MenuItem = menuItem;
            wf.HotkeyConfig.UpdateMenuItemShortcut();
            wf.HotkeyConfig.HotkeyStatus = hotkeyForm.RegisterHotkey(wf.HotkeyConfig.Hotkey, action, wf.HotkeyConfig.Tag);

            Workflow wfOld = this.Workflows.FirstOrDefault(x => x.HotkeyConfig.Tag == wf.HotkeyConfig.Tag);
            if (wfOld != null)
                wfOld = wf;
            else
                Workflows.Add(wf);
        }
Exemplo n.º 5
0
        public void PrepareHotkeys(HotkeyManager hotkeyManager, Workflow workflow)
        {
            if (hotkeyManager != null)
            {
                _manager = hotkeyManager;
                _workflow = workflow;

                log.DebugFormat("{0} hotkeys are ready.", _manager.Workflows.Count);

                flpHotkeys.Controls.Clear();
                foreach (Control ctl in this.Controls)
                {
                    ctl.Enabled = true;
                }

                foreach (Workflow wf in _manager.Workflows)
                {
                    HotkeySelectionControl control = new HotkeySelectionControl(wf);
                    control.HotkeyChanged += new EventHandler(control_HotkeyChanged);
                    flpHotkeys.Controls.Add(control);
                }
            }
            else
            {
                log.Debug("Hotkeys are not ready yet.");
                foreach (Control ctl in this.Controls)
                {
                    ctl.Enabled = false;
                }

                flpHotkeys.Controls.Clear();
                flpHotkeys.Controls.Add(new Label()
                {
                    Text = "Hotkeys are not ready yet. \n\nThis is most probably due to Dropbox Sync is still in progress.",
                    AutoSize = true
                });
            }
        }
Exemplo n.º 6
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            Workflow wf = new Workflow("New Workflow", new HotkeySetting(), false);
            WindowWorkflow wwf = new WindowWorkflow(wf);

            if (wwf.ShowDialog() == DialogResult.OK)
            {
                _manager.Workflows.Add(wf);
                HotkeySelectionControl control = new HotkeySelectionControl(wf);
                control.HotkeyChanged += new EventHandler(control_HotkeyChanged);
                flpHotkeys.Controls.Add(control);
                lblHelp.Text = "Your new hotkey will not be active until you close Settings.";
            }
        }