Esempio n. 1
0
        public static string Print(DataNode node, bool showType)
        {
            if (!_key.ContainsKey(node.GetType()))
                return "";

            if (showType)
                return "<" + _key[node.GetType()] + "> " + node.NodeDisplay;
            else
                return node.NodeDisplay;
        }
Esempio n. 2
0
        private TreeNode CreateUnexpandedNode(DataNode node)
        {
            TreeNode frontNode = new TreeNode(node.NodeDisplay);
            frontNode.ImageIndex = _iconRegistry.Lookup(node.GetType());
            frontNode.SelectedImageIndex = frontNode.ImageIndex;
            frontNode.Tag = node;
            frontNode.ContextMenuStrip = BuildNodeContextMenu(node);

            if (node.HasUnexpandedChildren || node.Nodes.Count > 0)
                frontNode.Nodes.Add(new TreeNode());

            return frontNode;
        }