Exemplo n.º 1
0
 public override void Undo()
 {
     if (newNode.IsEditing) {
         newNode.EndEdit(true);
     }
     TreeParent np = new TreeParent(this.view, this.doc, newNode);
     np.Remove(newNode);
 }
Exemplo n.º 2
0
        public override void Undo()
        {
            // Cannot use this.sourceParent because this points to the old source position
            // not the current position.
            TreeParent parent = new TreeParent(this.sourceParent.View, this.sourceParent.Document, this.source);
            parent.Remove(this.source);

            // If the node was not in the tree, then undo just removes it, it does not
            // have to re-insert back in a previous position, because it was a new node
            // (probably inserted via drag/drop).
            if (this.sourceParent.IsNodeInTree) {
                this.sourceParent.Insert(this.sourcePosition, InsertPosition.Before, source, true);
                if (source.Parent != null && source.Parent.Nodes.Count == 1) {
                    source.Parent.Expand();
                }
                source.TreeView.SelectedNode = source;
            } else {
                this.target.TreeView.SelectedNode = target;
            }
        }
Exemplo n.º 3
0
 public override void Undo()
 {
     this.view.BeginUpdate();
     try
     {
         if (newNode.IsEditing)
         {
             newNode.EndEdit(true);
         }
         TreeParent np = new TreeParent(this.view, this.doc, newNode);
         np.Remove(newNode);
     }
     finally
     {
         this.view.EndUpdate();
     }
 }