예제 #1
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));
        }
예제 #2
0
 private ToolCommandBinding GetCommandBinding(GestureData data)
 {
     return(data.Context.Items.GetValue <Tool>().GetToolCommandBinding((ICommand)this, data));
 }
예제 #3
0
 private void OnUnionSelectObject(object sender, ExecutedToolEventArgs e)
 {
     Performance.StartTiming(PerformanceMarks.SelectionChange);
     SelectionOperations.Union(this.Context, GestureData.FromEventArgs(e).ImpliedSource);
     Performance.StopTiming(PerformanceMarks.SelectionChange);
 }