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(); }
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); }