/// <summary> /// 加载数据库脚本树 /// </summary> private void LoadDataBaseScriptTree() { treePh.Nodes.Clear(); // 加载数据库脚本 TreePhOpera tpo = new TreePhOpera(); Hashtable htable = new Hashtable(); DataBaseManager dbm = DataBaseManager.GetDataBaseManager(); treePh.Tag = dbm.GetScriptInformation(); htable["dtable"] = dbm.GetScriptInformation(); htable["pop_folder"] = popTreePh_Folder; htable["pop_file"] = popTreePh_File; htable["scriptType"] = "databaseFile"; foreach (TreeNode tn in tpo.LoadTreeNodeCollection(htable)) { treePh.Nodes.Add(tn); tn.Expand(); } // 增加本地文件结点 Hashtable infoTable = new Hashtable(); infoTable["type"] = "folder"; localFileRootNode = TreePhOpera.CreateNode("本地文件", "folder", popTreePh_LocalFileRoot, infoTable); treePh.Nodes.Add(localFileRootNode); }
/// <summary> /// 加载本地脚本树 /// </summary> private void LoadLocalScriptTree() { // 读取配置文件 List<string> fileNameList = LoadLocalFileList(); localFileList = fileNameList; // 加载数据库脚本 TreePhOpera tpo = new TreePhOpera(); Hashtable infoTable = new Hashtable(); DataTable treeTable = new DataTable(); DataColumn idColumn = new DataColumn("id"); DataColumn pathColumn = new DataColumn("path"); treeTable.Columns.Add(idColumn); treeTable.Columns.Add(pathColumn); foreach (string s in fileNameList) { DataRow newRow = treeTable.NewRow(); newRow["id"] = "0"; newRow["path"] = s; treeTable.Rows.Add(newRow); } infoTable["dtable"] = treeTable; ArrayList icoList = new ArrayList(); icoList.Add("folder"); icoList.Add("file"); infoTable["icolist"] = icoList; infoTable["pop_folder"] = popTreePh_LocalFolder; infoTable["pop_file"] = popTreePh_LocalFile; infoTable["scriptType"] = "localFile"; foreach (TreeNode tn in tpo.LoadTreeNodeCollection(infoTable)) { localFileRootNode.Nodes.Add(tn); tn.Expand(); } }