예제 #1
0
 public static WheelGestureData FromEventArgs(CanExecuteToolEventArgs e)
 {
     if (e == null)
     {
         throw new ArgumentNullException("e");
     }
     return(GestureData.FromParameter <WheelGestureData>(e.Parameter));
 }
예제 #2
0
        internal bool OnExecute(EditingContext sender, ExecutedToolEventArgs e)
        {
            CanExecuteToolEventArgs e1 = new CanExecuteToolEventArgs((ICommand)this._command, e.Parameter);

            if (this.Execute == null || !this.OnCanExecute(sender, e1))
            {
                return(false);
            }
            this.Execute((object)sender, e);
            return(true);
        }
예제 #3
0
 internal bool OnCanExecute(EditingContext sender, CanExecuteToolEventArgs e)
 {
     if (this.CanExecute != null)
     {
         this.CanExecute((object)sender, e);
         if (!e.CanExecute)
         {
             return(false);
         }
     }
     return(e.CanExecute = this.Execute != null);
 }
예제 #4
0
        public bool CanExecute(GestureData data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }
            if (data.Context == null)
            {
                throw new ArgumentException(Resources.Error_MissingContext);
            }
            ToolCommandBinding commandBinding = this.GetCommandBinding(data);

            if (commandBinding == null)
            {
                return(false);
            }
            CanExecuteToolEventArgs e = new CanExecuteToolEventArgs((ICommand)this, (object)data);

            return(commandBinding.OnCanExecute(data.Context, e));
        }