예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
        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);
        }
예제 #4
0
 /// <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"));
     }
 }