private void DuplicateBranchExecute(object cmdParameter) { var node = GetOperationNode().Duplicate(); if (node != null) { PageTreeChanged(); CreatePageCommand cmd = new CreatePageCommand(this, node, node.Parent, node.IndexInParent, _pageTree); _undoManager.Push(cmd); } }
private void AddPageRequestExecute(Guid cmdParameter) { if (cmdParameter == Guid.Empty) { INodeViewModel Node = GetOperationNode().Add(GetNextDataName(TreeNodeType.Page)); Node.IsSelected = true; CreatePageCommand cmd = new CreatePageCommand(this, Node, Node.Parent, Node.IndexInParent, _pageTree); _undoManager.Push(cmd); this._ListEventAggregator.GetEvent <AddNewPageEvent>().Publish(Node.Guid); } }
private void AddChildExecute(object cmdParameter) { INodeViewModel Node = GetOperationNode().AddChild(GetNextDataName(TreeNodeType.Page)); Node.IsSelected = true; Node.IsNodeEditable = true; PageTreeChanged(); CreatePageCommand cmd = new CreatePageCommand(this, Node, Node.Parent, Node.IndexInParent, _pageTree); _undoManager.Push(cmd); }
/// <summary> /// Duplicate page/folder /// </summary> private void DuplicateNodeExecute(object cmdParameter) { try { NodeViewModel Node = GetOperationNode().Duplicate(false); CreatePageCommand cmd = new CreatePageCommand(this, Node, Node.Parent, Node.IndexInParent, _pageTree); _undoManager.Push(cmd); } catch (Exception e) { MessageBox.Show(GlobalData.FindResource("Warn_Copy_Mem_Info"), GlobalData.FindResource("Common_Error")); } }