public void Undo() { if (node.Previous != null) { node.AttachTo(node.Parent, node.Previous, true, node.Pos); } else // insert as the first child { node.AttachTo(node.Parent, node.Parent.FirstChild, false, node.Pos); } }
public void Undo() { if (siblingAbove != null) //attach after sibling { node.AttachTo(parent, siblingAbove, true, position); } else if (parent.FirstChild != null) //insert as the first child { node.AttachTo(parent, parent.FirstChild, false, position); } else //attach as only child { node.AttachTo(parent, null, true, position); } }