コード例 #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
 public static void CutKeyframes(SceneViewModel viewModel, SceneElement targetElement, ICollection <KeyFrameSceneNode> keyframes)
 {
     CopyCommand.CopyKeyframes(viewModel, targetElement, keyframes);
     foreach (KeyFrameSceneNode keyFrameSceneNode in (IEnumerable <KeyFrameSceneNode>)keyframes)
     {
         viewModel.AnimationEditor.DeleteKeyframe(keyFrameSceneNode.TargetElement, keyFrameSceneNode.TargetProperty, keyFrameSceneNode.Time);
     }
 }