コード例 #1
0
        public override void undo()
        {
            if ((mNode != null) && (mNodeBeforeChanges != null))
            {
                mNode.copy(mNodeBeforeChanges);

                TreeNode curTreeNode = findTreeNode(mNode);
                mNode.updateTreeNodeText(curTreeNode);
            }
        }
コード例 #2
0
        public override void undo()
        {
            // Add the child back under the parent node
            if ((mParentNode != null) && (mDeletedNode != null))
            {
                TreeNode parentTreeNode  = findTreeNode(mParentNode);
                TreeNode deletedTreeNode = mDeletedNode.createTreeNode();

                mParentNode.insertChild(mDeletedNodeIndex, mDeletedNode);
                parentTreeNode.Nodes.Insert(mDeletedTreeNodeIndex, deletedTreeNode);

                // Update parent tree node text
                mParentNode.updateTreeNodeText(parentTreeNode);

                // Expand parent node, and expand all child node
                parentTreeNode.Expand();
                deletedTreeNode.ExpandAll();
            }
        }
コード例 #3
0
        public override void undo()
        {
            // Remove the child from the parent
            if ((mParentNode != null) && (mAddedNode != null))
            {
                mParentNode.removeChild(mAddedNode);

                TreeNode parentTreeNode = findTreeNode(mParentNode);
                foreach (TreeNode curTreeNode in parentTreeNode.Nodes)
                {
                    if (curTreeNode.Tag == mAddedNode)
                    {
                        parentTreeNode.Nodes.Remove(curTreeNode);
                        break;
                    }
                }

                // Update parent tree node text
                mParentNode.updateTreeNodeText(parentTreeNode);
            }
        }