Exemplo n.º 1
0
 public override void Execute()
 {
     using (SceneEditTransaction editTransaction = this.SceneViewModel.CreateEditTransaction(StringTable.UndoUnitDelete))
     {
         ToolManager toolManager = this.designerContext.ToolManager;
         if (!this.SceneViewModel.StoryboardSelectionSet.IsEmpty)
         {
             this.StoryboardDelete();
         }
         else if (!this.SceneViewModel.AnimationSelectionSet.IsEmpty && this.SceneViewModel.PathPartSelectionSet.IsEmpty)
         {
             this.AnimationDelete();
         }
         else if (!this.SceneViewModel.KeyFrameSelectionSet.IsEmpty)
         {
             this.KeyFrameDelete();
         }
         else if (!this.SceneViewModel.SetterSelectionSet.IsEmpty)
         {
             this.SetterDelete();
         }
         else if (this.SceneViewModel.TextSelectionSet.IsActive)
         {
             this.TextDelete();
         }
         else if (!this.SceneViewModel.ChildPropertySelectionSet.IsEmpty)
         {
             this.ChildPropertyDelete();
         }
         else if (!this.SceneViewModel.BehaviorSelectionSet.IsEmpty)
         {
             this.BehaviorDelete();
         }
         else if (!this.SceneViewModel.AnnotationSelectionSet.IsEmpty)
         {
             this.designerContext.AnnotationService.Delete((IEnumerable <AnnotationSceneNode>) this.SceneViewModel.AnnotationSelectionSet.Selection);
         }
         else if (this.SceneViewModel.GridColumnSelectionSet.GridLineMode && !this.SceneViewModel.GridColumnSelectionSet.IsEmpty)
         {
             this.GridColumnDelete();
         }
         else if (this.SceneViewModel.GridRowSelectionSet.GridLineMode && !this.SceneViewModel.GridRowSelectionSet.IsEmpty)
         {
             this.GridRowDelete();
         }
         else if (toolManager.ActiveTool == toolManager.FindTool(typeof(SubselectionTool)) && !this.SceneViewModel.PathPartSelectionSet.IsEmpty)
         {
             this.DeleteLeftoverElements(this.PathPartDelete(editTransaction));
         }
         else if (toolManager.ActiveTool == toolManager.FindTool(typeof(PenTool)))
         {
             PenCreateBehavior penCreateBehavior = this.designerContext.ActiveView.EventRouter.ActiveBehavior as PenCreateBehavior;
             if (penCreateBehavior != null && ((PenTool)penCreateBehavior.Tool).ActivePathEditInformation != null)
             {
                 penCreateBehavior.DeleteLastSegment();
             }
             else if (!this.SceneViewModel.PathPartSelectionSet.IsEmpty)
             {
                 this.DeleteLeftoverElements(this.PathPartDelete(editTransaction));
             }
             else
             {
                 this.SceneViewModel.DeleteSelectedElements();
             }
         }
         else
         {
             this.SceneViewModel.DeleteSelectedElements();
         }
         editTransaction.Commit();
     }
 }