public static WheelGestureData FromEventArgs(ExecutedToolEventArgs e)
 {
     if (e == null)
     {
         throw new ArgumentNullException("e");
     }
     return(GestureData.FromParameter <WheelGestureData>(e.Parameter));
 }
        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);
        }
Exemple #3
0
        private void OnSelectOnlyObject(object sender, ExecutedToolEventArgs e)
        {
            GestureData gestureData = GestureData.FromEventArgs(e);

            if (gestureData.ImpliedSource == null)
            {
                return;
            }
            Performance.StartTiming(PerformanceMarks.SelectionChange);
            SelectionOperations.SelectOnly(this.Context, gestureData.ImpliedSource);
            Performance.StopTiming(PerformanceMarks.SelectionChange);
        }
Exemple #4
0
        public void Execute(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;
            }
            ExecutedToolEventArgs e = new ExecutedToolEventArgs((ICommand)this, (object)data);

            commandBinding.OnExecute(data.Context, e);
        }
Exemple #5
0
 private void OnShowEvent(object sender, ExecutedToolEventArgs e)
 {
     SelectionImplementation.ShowDefaultEvent(this.Context);
 }
Exemple #6
0
 private void OnUnionSelectObject(object sender, ExecutedToolEventArgs e)
 {
     Performance.StartTiming(PerformanceMarks.SelectionChange);
     SelectionOperations.Union(this.Context, GestureData.FromEventArgs(e).ImpliedSource);
     Performance.StopTiming(PerformanceMarks.SelectionChange);
 }