private void ShortcutComboBox_SelectedIndexChanged(object sender, EventArgs e) { if (HandleSelectedItemChanged && MenuTree.SelectedNode != null && ShortcutComboBox.SelectedItem != null) { NuGenMenuItemShortcut menuItemShortcut = (NuGenMenuItemShortcut)MenuTree.SelectedNode.Tag; menuItemShortcut.UpdateShortcut(NuGenShortcutConverter.ConvertStringToShortcut((string)ShortcutComboBox.SelectedItem)); MenuTree.SelectedNode.Text = menuItemShortcut.GetText(); } }
private void CreateShortcutComboBox(TableLayoutPanel panel) { ShortcutComboBox = new ComboBox(); ShortcutComboBox.DropDownStyle = ComboBoxStyle.DropDownList; Array shortcutValues = Enum.GetValues(typeof(Shortcut)); for (int index = 0; index < shortcutValues.Length; index++) { ShortcutComboBox.Items.Add(NuGenShortcutConverter.ConvertShortcutToString((Shortcut)shortcutValues.GetValue(index))); } ShortcutComboBox.SelectedIndexChanged += new EventHandler(ShortcutComboBox_SelectedIndexChanged); panel.Controls.Add(ShortcutComboBox); panel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, ShortcutComboBox.Width)); }
public string GetShortcutText() { return(NuGenShortcutConverter.ConvertShortcutToString(Shortcut)); }