Ejemplo n.º 1
0
 public MenuHotkey(KeyOrMouseButton key, [NotNull] Action <MenuInputEventArgs> action, HotkeyFlags flags)
 {
     this.Flags  = flags;
     this.action = action ?? throw new ArgumentNullException(nameof(action));
     this.Hotkey = key;
     this.Name   = Guid.NewGuid().ToString();
 }
Ejemplo n.º 2
0
        public MenuHotkey RegisterHotkey(KeyOrMouseButton key, Action <MenuInputEventArgs> action, HotkeyFlags flags = HotkeyFlags.Press)
        {
            var hotkey = new MenuHotkey(key, action, flags);

            this.hotkeys.Add(hotkey);

            return(hotkey);
        }