コード例 #1
0
        public void AttachSubTree(DBMSPlatformEnum dbmsEnum, IDataTableTree dataSourceTree)
        {
            DataNode <string, Cell> dataRoot = dataSourceTree.Root;

            if (dataRoot.Children.Count < 1)
            {
                return;
            }

            TreeNode dbmsRoot    = AddDBMSRoot(dbmsEnum);
            TreeNode subTreeRoot = dbmsRoot.Nodes.Add(dataRoot.Id);

            AddChildNodes(subTreeRoot, dataRoot.Children.Values, dataSourceTree);
        }
コード例 #2
0
ファイル: DataTableTree.cs プロジェクト: zhoufengzd/DotNet
 public TableLink(IDataTableTree tree, Cell cell)
 {
     _tree = tree;
     _cell = cell;
 }
コード例 #3
0
        private void AddChildNodes(TreeNode vwParentNode, ICollection <DataNode <string, Cell> > childrenData, IDataTableTree objTree)
        {
            foreach (DataNode <string, Cell> nodeData in childrenData)
            {
                TreeNode child = new TreeNode();

                bool isGroup = (nodeData.Children.Count > 0);
                child.Text               = objTree.ToString(nodeData.Data);
                child.ImageIndex         = (isGroup) ? 6 : 8;
                child.SelectedImageIndex = child.ImageIndex;
                child.Tag = new TableLink(objTree, nodeData.Data);
                vwParentNode.Nodes.Add(child);

                if (isGroup)
                {
                    AddChildNodes(child, nodeData.Children.Values, objTree);
                }
            }
        }