public void LoadScripts(List <Entity> scripts) { ScriptsTreeView.Nodes.Clear(); foreach (Entity script in scripts) { string[] nameParts = script["name"].ToString().Split('/'); AddNode(nameParts, 0, ScriptsTreeView, script); } ScriptsTreeView.TreeViewNodeSorter = new NodeSorter(); ScriptsTreeView.Sort(); ScriptsTreeView.ExpandAll(); ScriptsTreeView.Invalidate(); }