示例#1
0
        public void Load(ConfigNode parent)
        {
            InitCommands();
            InitFixedCommands();

            ConfigNode node = parent.FindChildConfigNode("key-definition");

            if (node != null)
            {
                IDictionaryEnumerator ie = node.GetPairEnumerator();
                while (ie.MoveNext())
                {
                    CID id = (CID)GUtil.ParseEnum(typeof(CID), (string)ie.Key, CID.NOP);
                    if (id == CID.NOP)
                    {
                        continue;
                    }
                    string value = (string)ie.Value;
                    Entry  e     = FindEntry(id);
                    Keys   t     = GUtil.ParseKey(value.Split(','));
                    e.Modifiers = t & Keys.Modifiers;
                    e.Key       = t & Keys.KeyCode;
                }
            }
        }
        private void ImportKeySettings(Hashtable values)
        {
            IDictionaryEnumerator ie = values.GetEnumerator();

            while (ie.MoveNext())
            {
                string name = (string)ie.Key;
                CID    cid  = (CID)GUtil.ParseEnum(typeof(CID), name, CID.NOP);
                if (cid != CID.NOP)
                {
                    Keys k = GUtil.ParseKey(((string)ie.Value).Split(','));
                    GApp.Options.Commands.ModifyKey(cid, k & Keys.Modifiers, k & Keys.KeyCode);
                }
            }
        }
示例#3
0
        public void Load(ConfigNode sec)
        {
            Path       = sec["path"];
            _title     = sec["title"];
            _debugMode = GUtil.ParseBool(sec["debug"], false);
            Keys   shortcut = Keys.None;
            string t        = sec["shortcut"];

            if (t != null)
            {
                shortcut = GUtil.ParseKey(t.Split(','));
            }
            GApp.Options.Commands.AddEntry(new Commands.MacroEntry(_title, shortcut & Keys.Modifiers, shortcut & Keys.KeyCode, _index));
            _additionalAssemblies = sec["additional-assemblies"].Split(',');
        }