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)); }
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); }
public void AddInList(Keys keys, Keys?modeKeys, KeyAction action) { KeyItem item = new KeyItem(keys, modeKeys, action); map.AddItem(item); list.Add(NamedAction.OfKeyItem(item)); }
public KeyItem(Keys keys, Keys?modeKeys, KeyAction action) { this.keys = keys; this.modeKeys = modeKeys; this.action = action; next = null; }
public void Add(Keys keys, Keys?modeKeys, KeyAction action) { KeyItem item = new KeyItem(keys, modeKeys, action); map.AddItem(item); }