private void AddsubFolders(string sDir, List <ITreeViewItem> Childrens) { try { foreach (string d in Directory.GetDirectories(Path)) { QCTestLabFolderTreeItem BFFTI = new QCTestLabFolderTreeItem(); string FolderName = System.IO.Path.GetFileName(d); BFFTI.Folder = FolderName; BFFTI.Path = d; Childrens.Add(BFFTI); } } catch (System.Exception excpt) { Console.WriteLine(excpt.Message); } }
List <ITreeViewItem> ITreeViewItem.Childrens() { CurrentChildrens = new List <ITreeViewItem>(); // get the sub items for the root here and return list of Childrens // Step #1 add sub folder of current folder List <string> strParentFolders = QCConnect.GetTestLabExplorer(Path); //Add QC folders to tree children foreach (string sFolder in strParentFolders) { QCTestLabFolderTreeItem pfn = new QCTestLabFolderTreeItem(); pfn.Folder = sFolder; pfn.Path = Path + @"\" + sFolder; CurrentChildrens.Add(pfn); } // Step #2 add folder Test Set list List <QCTestSetSummary> sTestSets = QCConnect.GetTestSetExplorer(Path); foreach (QCTestSetSummary tsItem in sTestSets) { tsItem.TestSetStatuses = new List <string[]>(); QCTestSetTreeItem pfn = new QCTestSetTreeItem(); pfn.TestSetID = tsItem.TestSetID.ToString(); pfn.TestSetName = tsItem.TestSetName; pfn.Path = Path + @"\" + tsItem.TestSetName; QCTestSetSummary tsItemStatus = QCConnect.GetTSRunStatus(tsItem); pfn.TestSetStatuses = tsItem.TestSetStatuses; //if (IsAutomated(pfn.TestSetID)) pfn.Automated = true; else pfn.Automated = false; //IsTestSetAlreadyImported(pfn); pfn.IsTestSetAlreadyImported(); CurrentChildrens.Add(pfn); } return(CurrentChildrens); }
List <ITreeViewItem> ITreeViewItem.Childrens() { CurrentChildrens = new List <ITreeViewItem>(); // get the sub items for the root here and return list of Childrens // Step #1 add sub folder of current folder List <string> strParentFolders = ALMIntegration.Instance.GetTestLabExplorer(Path); //Add QC folders to tree children foreach (string sFolder in strParentFolders) { QCTestLabFolderTreeItem pfn = new QCTestLabFolderTreeItem(); pfn.Folder = sFolder; pfn.Path = Path + @"\" + sFolder; CurrentChildrens.Add(pfn); } // Step #2 add folder Test Set list List <ALMTestSetSummary> sTestSets = (List <ALMTestSetSummary>)ALMIntegration.Instance.GetTestSetExplorer(Path); foreach (ALMTestSetSummary tsItem in sTestSets) { tsItem.TestSetStatuses = new List <string[]>(); QCTestSetTreeItem pfn = new QCTestSetTreeItem(); pfn.TestSetID = tsItem.TestSetID.ToString(); pfn.TestSetName = tsItem.TestSetName; pfn.Path = Path + @"\" + tsItem.TestSetName; ALMTestSetSummary tsItemStatus = ALMIntegration.Instance.GetTSRunStatus(tsItem); pfn.TestSetStatuses = tsItem.TestSetStatuses; pfn.IsTestSetAlreadyImported(); CurrentChildrens.Add(pfn); } return(CurrentChildrens); }