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

            if (gestureData == null)
            {
                return(false);
            }
            return(this.CanExecute(gestureData));
        }
示例#5
0
 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;
 }