Beispiel #1
0
 void ICommand.Execute(object parameter)
 {
     if (parameter == null)
     {
         throw new ArgumentNullException("parameter");
     }
     this.Execute(ToolCommand.GetGestureData(parameter, true));
 }
Beispiel #2
0
 private static ToolCommand EnsureCommand(ref ToolCommand command, string name)
 {
     if (command == null)
     {
         command = new ToolCommand(name);
     }
     return(command);
 }
 public ToolCommandBinding(ToolCommand command)
 {
     if (command == null)
     {
         throw new ArgumentNullException("command");
     }
     this.Command = command;
 }
Beispiel #4
0
        bool ICommand.CanExecute(object parameter)
        {
            GestureData gestureData = ToolCommand.GetGestureData(parameter, false);

            if (gestureData == null)
            {
                return(false);
            }
            return(this.CanExecute(gestureData));
        }
 public ToolCommandBinding(ToolCommand command, ExecutedToolEventHandler executedToolEventHandler)
 {
     if (command == null)
     {
         throw new ArgumentNullException("command");
     }
     if (executedToolEventHandler == null)
     {
         throw new ArgumentNullException("executedToolEventHandler");
     }
     this.Execute += executedToolEventHandler;
     this.Command  = command;
 }