Esempio n. 1
0
        /*
         * 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)
        {
            TreeNode tn = new TreeNode(tln.Name, tln.ImageIndex,
                                       (int)ITlibNode.ImageIndices.idx_selected,
                                       tln.Children.ConvertAll(x => GenNodeTree(x, nl)).ToArray());

            tn.Tag = tln;
            nl.Add(tn);
            return(tn);
        }
Esempio n. 2
0
        public wooctrl(ImageList imglstTreeNodes, ImageList imglstMisc, OWTypeLib tlib)
        {
            _tlib = tlib;
            _nl   = new NodeLocator();
            _iml  = imglstMisc;
            _sort = SortType.Sorted_Numerically;

            InitializeComponent();
            this.txtOleDescrPlain.ParentCtrl = this;
            tvLibDisp.ImageList = imglstTreeNodes;
            this.Dock           = DockStyle.Fill;

            tvLibDisp.Nodes.Add(GenNodeTree(tlib, _nl));
            this.txtOleDescrPlain.NodeLocator = _nl;
            tvLibDisp.Nodes[0].Expand();
        }