private void InsertSyntaxTreeViewNode(Unit unit, TreeNode node) { var newNode = node?.Nodes.Add(unit.GetType().Name) ?? treeView1.Nodes.Add(unit.GetType().Name); foreach (var child in unit.Children) InsertSyntaxTreeViewNode(child,newNode); }
private void UpdateSyntaxTreeView(Unit unit) { treeView1.BeginUpdate(); treeView1.Nodes.Clear(); InsertSyntaxTreeViewNode(unit,null); treeView1.ExpandAll(); treeView1.EndUpdate(); }