private void ShowProp(int index) { MacroModule mod = GApp.MacroManager.GetModule(index); Keys key = Keys.None; IDictionaryEnumerator ie = _keyToModule.GetEnumerator(); while (ie.MoveNext()) { if (ie.Value == mod) { key = (Keys)(ie.Key); break; } } ModuleProperty dlg = new ModuleProperty(this, mod, key); if (GCUtil.ShowModalDialog(this, dlg) == DialogResult.OK) { GApp.MacroManager.ReplaceModule(GApp.MacroManager.GetModule(index), dlg.Module); GApp.Options.Commands.ModifyMacroKey(dlg.Module.Index, dlg.ShortCut & Keys.Modifiers, dlg.ShortCut & Keys.KeyCode); ListViewItem li = _list.Items[index]; li.Text = dlg.Module.Title; li.SubItems[1].Text = dlg.Module.Path; li.SubItems[2].Text = UILibUtil.KeyString(dlg.ShortCut); li.SubItems[3].Text = GetInfoString(dlg.Module); _keyToModule.Remove(key); if (dlg.ShortCut != Keys.None) { _keyToModule.Add(dlg.ShortCut, dlg.Module); } AdjustUI(); } }
private void OnAddButtonClicked(object sender, EventArgs args) { ModuleProperty dlg = new ModuleProperty(this, null, Keys.None); if (GCUtil.ShowModalDialog(this, dlg) == DialogResult.OK) { AddListItem(dlg.Module, dlg.ShortCut); GApp.MacroManager.AddModule(dlg.Module); if (dlg.ShortCut != Keys.None) { _keyToModule.Add(dlg.ShortCut, dlg.Module); } AdjustUI(); } }
private void ShowProp(int index) { MacroModule mod = GApp.MacroManager.GetModule(index); Keys key = Keys.None; IDictionaryEnumerator ie = _keyToModule.GetEnumerator(); while(ie.MoveNext()) { if(ie.Value==mod) { key = (Keys)(ie.Key); break; } } ModuleProperty dlg = new ModuleProperty(this, mod, key); if(GCUtil.ShowModalDialog(this, dlg)==DialogResult.OK) { GApp.MacroManager.ReplaceModule(GApp.MacroManager.GetModule(index), dlg.Module); GApp.Options.Commands.ModifyMacroKey(dlg.Module.Index, dlg.ShortCut & Keys.Modifiers, dlg.ShortCut & Keys.KeyCode); ListViewItem li = _list.Items[index]; li.Text = dlg.Module.Title; li.SubItems[1].Text = dlg.Module.Path; li.SubItems[2].Text = UILibUtil.KeyString(dlg.ShortCut); li.SubItems[3].Text = GetInfoString(dlg.Module); _keyToModule.Remove(key); if(dlg.ShortCut!=Keys.None) _keyToModule.Add(dlg.ShortCut, dlg.Module); AdjustUI(); } }
private void OnAddButtonClicked(object sender, EventArgs args) { ModuleProperty dlg = new ModuleProperty(this, null, Keys.None); if(GCUtil.ShowModalDialog(this, dlg)==DialogResult.OK) { AddListItem(dlg.Module, dlg.ShortCut); GApp.MacroManager.AddModule(dlg.Module); if(dlg.ShortCut!=Keys.None) _keyToModule.Add(dlg.ShortCut, dlg.Module); AdjustUI(); } }