private void CallMakePretty() { Tree tree = new Tree(selectedNodes,Lines); Tree wholeTree = new Tree(tree.getWholeTree(),Lines); if (wholeTree.allNodesOneParentAndLessThanThreeChildren()) undoRedo.InsertInUndoRedo(new MakePrettyCommand(Nodes, selectedNodes)); }