Ejemplo n.º 1
0
 protected virtual void OnCommandReceived(CommandEventArgs commandeventargs)
 {
     CommandEventHandler handler = CommandReceived;
     if (handler != null) {
         handler(this, commandeventargs);
     }
 }
Ejemplo n.º 2
0
        private bool SendCommandEvents(Command command, object args)
        {
            var target = _presentationManager.GetFocusedElement();

            // send to GUI handlers
            if (target != null) {
                if (SendTunneledEvent(target, command, args)) {
                    return true;
                }

                if (SendBubbledEvent(target, command, args)) {
                    return true;
                }
            }

            // send to global handlers
            var eventArgs = new CommandEventArgs { Command = command, Args = args };
            OnCommandReceived(eventArgs);
            return eventArgs.Handled;
        }
Ejemplo n.º 3
0
 private void commandManager_CommandReceived(object sender, CommandEventArgs commandEventArgs)
 {
     _logger.Debug("commandManager_CommandReceived {0} {1}", commandEventArgs.Command, commandEventArgs.Args);
     commandEventArgs.Handled = _defaultCommandActionMap.ExecuteCommand(commandEventArgs.Command);
 }