예제 #1
0
 public override void Execute()
 {
     if (this.SceneViewModel.TextSelectionSet.IsActive)
     {
         this.SceneViewModel.TextSelectionSet.TextEditProxy.EditingElement.Copy();
     }
     else if (!this.SceneViewModel.KeyFrameSelectionSet.IsEmpty)
     {
         CopyCommand.CopyKeyframes(this.SceneViewModel, this.SceneViewModel.KeyFrameSelectionSet.Selection[0].TargetElement as SceneElement, (ICollection <KeyFrameSceneNode>) this.SceneViewModel.KeyFrameSelectionSet.Selection);
     }
     else if (!this.SceneViewModel.ChildPropertySelectionSet.IsEmpty)
     {
         CopyCommand.CopyPropertyNodes(this.SceneViewModel, (IList <SceneNode>) this.SceneViewModel.ChildPropertySelectionSet.Selection);
     }
     else if (!this.SceneViewModel.BehaviorSelectionSet.IsEmpty)
     {
         CopyCommand.CopyBehaviorNodes(this.SceneViewModel, (IList <BehaviorBaseNode>) this.SceneViewModel.BehaviorSelectionSet.Selection);
     }
     else if (!this.SceneViewModel.AnnotationSelectionSet.IsEmpty && this.DesignerContext.AnnotationService != null)
     {
         this.DesignerContext.AnnotationService.CopyToClipboardAsText((IEnumerable <AnnotationSceneNode>) this.SceneViewModel.AnnotationSelectionSet.Selection);
     }
     else
     {
         List <SceneElement> elements = new List <SceneElement>((IEnumerable <SceneElement>) this.SceneViewModel.ElementSelectionSet.Selection);
         elements.Sort((IComparer <SceneElement>) new ZOrderComparer <SceneElement>(this.SceneViewModel.RootNode));
         CopyCommand.CopyElements(this.SceneViewModel, elements);
     }
 }
예제 #2
0
 private static void CutBehaviorNodes(SceneViewModel viewModel, IList <BehaviorBaseNode> behaviorNodes)
 {
     CopyCommand.CopyBehaviorNodes(viewModel, behaviorNodes);
     foreach (BehaviorBaseNode node in (IEnumerable <BehaviorBaseNode>)behaviorNodes)
     {
         BehaviorHelper.DeleteBehavior(node);
     }
 }