示例#1
0
        public void WriteXml(XmlWriter writer)
        {
            writer.WriteComment("An example hotkey would be 'Ctrl+C'. You can specify multiple hotkeys per command like this 'Shift+Ctrl+T, Alt+I'.");
            writer.WriteComment("You may combine any key with Ctrl, Shift or Alt, but other combinations are not allowed.");
            writer.WriteComment("For a comprehensive list of possible keys look here: https://msdn.microsoft.com/en-us/library/system.windows.forms.keys(v=vs.110).aspx#Members ");
            HotkeySets @default = new HotkeySets();

            foreach (var commandAndHotkey in _list)
            {
                bool isDefault = commandAndHotkey.Value.SetEquals(@default[commandAndHotkey.Key]);
                writer.WriteStartElement("HotkeySet");
                writer.WriteAttributeString("CommandName", commandAndHotkey.Key);
                writer.WriteAttributeString("Hotkeys", isDefault ? "UseDefault" : string.Join(", ", commandAndHotkey.Value));
                writer.WriteEndElement();
            }
        }
示例#2
0
 private HotkeySets(HotkeySets other)
 {
     _list = new SortedList <string, SortedSet <Hotkey> >(
         other._list.DicSelect(e => new SortedSet <Hotkey>(e.Value)), StringComparer.InvariantCultureIgnoreCase);
 }