Consolidate tree processing

- Only build treeview once, destroy/create child content on change
- Single recursive AddTree(IObject3D) method handles all nodes
- BuildTree caller assigns node.TreeView instance on root node
- MatterHackers/MCCentral#3483
Differing construction implementations results in inconsistent TreeNodes
This commit is contained in:
John Lewin 2018-06-01 08:49:02 -07:00
parent 9e69b4a915
commit 5244025ae3
5 changed files with 48 additions and 70 deletions

View file

@ -378,7 +378,14 @@ namespace MatterHackers.MatterControl.CustomWidgets.TreeView
// A TreeView that represents the parent tree view that the
// tree node is assigned to, or null if the node has not been assigned to a tree
// view.
public virtual TreeView TreeView => NodeParent.TreeView;
private TreeView _treeView;
public virtual TreeView TreeView
{
get => _treeView ?? NodeParent.TreeView;
set => _treeView = value;
}
private void OnImageChanged(EventArgs args)
{