示例#1
0
        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);
        }
示例#3
0
 public static bool IsHandler(string category, Keys keys)
 {
     HotkeyCommand[] handledHotkeys = HotkeySettingsManager.LoadHotkeys(category);
     return(handledHotkeys.Any(hk => hk != null && hk.KeyData == keys));
 }