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); } }
public static void CutElements(SceneViewModel viewModel, List <SceneElement> elements) { CopyCommand.CopyElements(viewModel, elements); foreach (SceneElement element in elements) { if (element.Parent != null) { viewModel.DeleteElementTree(element); } } }