public object Clone() { try { InputFileTag tag = new InputFileTag(); tag.TypeDesc = TypeDesc; tag.AllowSelection = AllowSelection; tag.DatabasePath = DatabasePath; tag.GroupName = GroupName; tag.FullPath = FullPath; tag.PassedChecks = PassedChecks; tag.ErrorMsg = ErrorMsg; return(tag); } catch (Exception exc) { throw exc; } }
public object Clone() { try { InputFileTag tag = new InputFileTag(); tag.TypeDesc = TypeDesc; tag.AllowSelection = AllowSelection; tag.DatabasePath = DatabasePath; tag.GroupName = GroupName; tag.FullPath = FullPath; tag.PassedChecks = PassedChecks; tag.ErrorMsg = ErrorMsg; return tag; } catch (Exception exc) { throw exc; } }
/// <summary> /// Populate a tree view with a directory structure /// </summary> /// <param name="sPath"></param> /// <param name="bInclSubFolders"></param> private void fillFileTreeViewRecursively(string currPath, TreeNode nodeParent, bool bInclSubDirs, string filterText, string basePath) { try { DirectoryInfo di = new DirectoryInfo(currPath); DirectoryInfo[] dis = di.GetDirectories(); //FileInfo[] fis = di.GetFiles("*" + filterText + "*" + ".pepxml", SearchOption.TopDirectoryOnly); FileInfo[] fis = di.GetFiles("*" + filterText + "*", SearchOption.TopDirectoryOnly); //string[] filters = filterText.Split(new Char[] { ';', ' ', '\t', ',' }); // filter separated by ";",",", ignore " " and "\t" //FileInfo[] fis = di.GetFiles(); //fis = filterFileInfoList(fis, filters); //fis = filterFileInfoListByExt(fis); foreach (FileInfo fi in fis) { TreeNode newFileNode; // string dbInFile = string.Empty; newFileNode = new TreeNode(returnLastPathLevel(fi.FullName)); InputFileTag newFileTag = new InputFileTag("file", fi.FullName, true); newFileNode.Tag = newFileTag; //checkAndSetFilteredFileNode(newFileNode, basePath); nodeParent.Nodes.Add(newFileNode); newFileNode.Name = fi.FullName; } if (bInclSubDirs) { foreach (DirectoryInfo diSub in dis) { TreeNode newDirNode; string parentPath = string.Empty; newDirNode = new TreeNode(returnLastPathLevel(diSub.FullName)); newDirNode.Tag = new InputFileTag("dir", diSub.FullName, true); fillFileTreeViewRecursively(diSub.FullName, newDirNode, bInclSubDirs, filterText, basePath); if (newDirNode.Nodes.Count > 0) { nodeParent.Nodes.Add(newDirNode); newDirNode.Name = diSub.FullName; } } } } catch (Exception exc) { throw new Exception("Error loading file list\r\n", exc); } }