public KeyPressCommandBinding(HotKeyManager hotKeyManager, ICommand command, Func<object> commandParameterCallback)
     : base(hotKeyManager, command)
 {
     _hotKeyManager = hotKeyManager;
     _commandParameterCallback = commandParameterCallback;
     _hotKeyManager.LocalHotKeyPressed += HotKeyManagerOnLocalHotKeyPressed;
 }
Exemplo n.º 2
0
        public MainForm()
        {
            InitializeComponent();
            hotKeyManager = new HotKeyManager(this);
            hotKeyManager.AddLocalHotKey(_copyHotKey);
            hotKeyManager.AddLocalHotKey(_pasteHotKey);
            hotKeyManager.AddLocalHotKey(_deleteHotKey);

            hotKeyManager.LocalHotKeyPressed += HotKeyManagerLocalHotKeyPressed;
        }
 protected override void OnComponentDisposed()
 {
     _hotKeyManager.LocalHotKeyPressed -= HotKeyManagerOnLocalHotKeyPressed;
     _hotKeyManager = null;
     _commandParameterCallback = null;
 }