private void refreshTree() { var treeView = _treeView; if (treeView == null) { return; } var root = new AGSTreeStringNode { Text = "" }; List <ITreeStringNode> toExpand = new List <ITreeStringNode>(); foreach (var pair in _props.OrderBy(p => p.Key.Z).ThenBy(p => p.Key.Name)) { ITreeStringNode cat = addToTree(pair.Key.Name, root); foreach (var prop in pair.Value.OrderBy(p => p.Name)) { addToTree(cat, prop); } if (pair.Key.Expand) { toExpand.Add(cat); } } treeView.Tree = root; treeView.Expand(root); foreach (var node in toExpand) { treeView.Expand(node); } }
private ITreeStringNode addToTree(string text, ITreeStringNode parent) { var node = new AGSTreeStringNode { Text = text }; if (parent != null) { node.TreeNode.SetParent(parent.TreeNode); } return(node); }
private void refreshTree() { var treeView = _treeView; if (treeView == null) { return; } var root = new AGSTreeStringNode { Text = "" }; foreach (var pair in _props.OrderBy(p => p.Key.Name)) { ITreeStringNode cat = addToTree(pair.Key.Name, root); foreach (var prop in pair.Value) { addToTree(cat, prop); } } treeView.Tree = root; treeView.Expand(root); }