private void ShowProp(int index) { MacroManager mm = MacroPlugin.Instance.MacroManager; MacroModule mod = mm.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); if (dlg.ShowDialog(this) == DialogResult.OK) { mm.ReplaceModule(mm.GetModule(index), dlg.Module); 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[2].Text = GetInfoString(dlg.Module); AdjustUI(); } }
private void OnAddButtonClicked(object sender, EventArgs args) { ModuleProperty dlg = new ModuleProperty(this, null); MacroManager mm = MacroPlugin.Instance.MacroManager; if (dlg.ShowDialog(this) == DialogResult.OK) { AddListItem(dlg.Module); mm.AddModule(dlg.Module); //if(dlg.ShortCut!=Keys.None) _keyToModule.Add(dlg.ShortCut, dlg.Module); AdjustUI(); } }