Пример #1
0
 public static WheelGestureData FromEventArgs(ExecutedToolEventArgs 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
        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);
        }
Пример #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);
        }
Пример #5
0
 private void OnShowEvent(object sender, ExecutedToolEventArgs e)
 {
     SelectionImplementation.ShowDefaultEvent(this.Context);
 }
Пример #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);
 }