/* * Note that this generates redundant tree nodes, i.e. many definitions of (eg) IUnknown * this is because Trees don't have support for child sharing. (how would the parent property work? :) */ private TreeNode GenNodeTree(ITlibNode tln, NodeLocator nl) { var tn = new TreeNode(tln.Name, tln.ImageIndex, (int)ITlibNode.ImageIndices.idx_selected, tln.Children.ConvertAll(x => GenNodeTree(x, nl)).ToArray()) { Tag = tln }; nl.Add(tn); return(tn); }
public Wooctrl(ImageList imglstTreeNodes, ImageList imglstMisc, OWTypeLib tlib) { _nl = new NodeLocator(); ImageList = imglstMisc; _sort = SortType.SortedNumerically; InitializeComponent(); txtOleDescrPlain.ParentCtrl = this; tvLibDisp.ImageList = imglstTreeNodes; Dock = DockStyle.Fill; tvLibDisp.Nodes.Add(GenNodeTree(tlib, _nl)); txtOleDescrPlain.NodeLocator = _nl; tvLibDisp.Nodes[0].Expand(); }