Exemplo n.º 1
0
        public static NamedAction OfKeyItem(KeyItem item)
        {
            string name = "[NONE]";
            string hint = null;
            Getter <Controller, bool> doOnDown = null;
            KeyAction action = item.action;

            if (action != null)
            {
                if (action.name != null)
                {
                    name = action.name;
                    int index = name.IndexOf('\\');
                    if (index != -1)
                    {
                        name = name.Substring(index + 1);
                    }
                    name = name.ToUpperInvariant();
                }
                if (item.keys != Keys.None)
                {
                    if (keysConverter == null)
                    {
                        keysConverter = new KeysConverter();
                    }
                    hint = item.keys == Keys.Alt ? "Alt" : keysConverter.ConvertToString(item.keys);
                }
                doOnDown = action.doOnDown;
            }
            return(new NamedAction(name, hint, doOnDown));
        }
Exemplo n.º 2
0
        private static KeyAction Add(string type, Getter <Controller, bool> doOnDown, Setter <Controller, bool> doOnModeChange, bool needScroll)
        {
            KeyAction action = new KeyAction(type, doOnDown, doOnModeChange, needScroll);

            actions.Add(action);
            return(action);
        }
Exemplo n.º 3
0
        public void AddInList(Keys keys, Keys?modeKeys, KeyAction action)
        {
            KeyItem item = new KeyItem(keys, modeKeys, action);

            map.AddItem(item);
            list.Add(NamedAction.OfKeyItem(item));
        }
Exemplo n.º 4
0
        public KeyItem(Keys keys, Keys?modeKeys, KeyAction action)
        {
            this.keys     = keys;
            this.modeKeys = modeKeys;
            this.action   = action;

            next = null;
        }
Exemplo n.º 5
0
        public void Add(Keys keys, Keys?modeKeys, KeyAction action)
        {
            KeyItem item = new KeyItem(keys, modeKeys, action);

            map.AddItem(item);
        }