private void UpdateText() { this.Text = keyData.ToText(); bool unique = HotkeySettingsManager.IsUnique(category, new HotkeyCommand(command.CommandCode, command.Name, keyData)); this.ForeColor = unique ? Color.Black : Color.DarkRed; }
public void ReadXML(XmlReader reader) { Dictionary <string, HotkeyCommand[]> hotkeys = new Dictionary <string, HotkeyCommand[]>(); reader.ReadStartElement(); while (reader.NodeType == XmlNodeType.Element) { if (reader.Name == "Hotkeys") { ParseHotkeys(reader, hotkeys); } else { reader.ReadOuterXml(); } } reader.ReadEndElement(); HotkeySettingsManager.Import(hotkeys); }
public static bool IsHandler(string category, Keys keys) { HotkeyCommand[] handledHotkeys = HotkeySettingsManager.LoadHotkeys(category); return(handledHotkeys.Any(hk => hk != null && hk.KeyData == keys)); }