private void PopulateFolders(CatalogItem[] items) { // create root TreeNode root = new TreeNode(); root.Text = "Root"; ssrsFolders.Nodes.Add(root); ssrsFolders.SelectedNode = ssrsFolders.TopNode; int j = 1; // Iterate through the list of items and find all of the folders and display them to the user foreach (CatalogItem ci in items) { if (ci.Type == ItemTypeEnum.Folder) { Regex rx = new Regex("/"); int matchCnt = rx.Matches(ci.Path).Count; if (matchCnt > j) { ssrsFolders.SelectedNode = ssrsFolders.SelectedNode.LastNode; j = matchCnt; } else if (matchCnt < j) { ssrsFolders.SelectedNode = ssrsFolders.SelectedNode.Parent; j = matchCnt; } AddNode(ci.Name); } } //we want to see them all ! ssrsFolders.ExpandAll(); }
private void PopulateDataSources(CatalogItem[] items) { int j = 0; // Iterate through the list of items and find all of the folders and display them to the user foreach (CatalogItem ci in items) { if (ci.Type == ItemTypeEnum.DataSource) { dataSources.Items.Add(ci.Name); j++; } } if (j == 0) dataSources.Items.Add("No data source found in " + dsLocation.Text); }