Ejemplo n.º 1
0
 public static WheelGestureData FromEventArgs(ExecutedToolEventArgs e)
 {
     if (e == null)
     {
         throw new ArgumentNullException("e");
     }
     return(GestureData.FromParameter <WheelGestureData>(e.Parameter));
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 5
0
 private void OnShowEvent(object sender, ExecutedToolEventArgs e)
 {
     SelectionImplementation.ShowDefaultEvent(this.Context);
 }
Ejemplo n.º 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);
 }