private void allFilesFolder_Click(object sender, EventArgs e) { selectFolder.ShowDialog(); DirectoryInfo dinfo = new DirectoryInfo(selectFolder.SelectedPath); try { FileInfo[] Files = dinfo.GetFiles("*.txt", SearchOption.AllDirectories); if (!Files.Any()) { return; } files = new List <DynamoFile>(); foreach (FileInfo directory in Files) { DynamoFile thisFile = new DynamoFile(directory.FullName); thisFile.GetType(); files.Add( thisFile ); } foreach (DynamoFile file in files) { ListViewItem item = new ListViewItem(file.ReturnItem()); fileList.Items.Add(( item )); } } catch (Exception ex) { Console.WriteLine(ex); } }
private void _addFiles(string[] fileNames) { files = new List <DynamoFile>(); foreach (string directory in fileNames) { DynamoFile thisFile = new DynamoFile(directory); thisFile.GetType(); files.Add( thisFile ); } foreach (DynamoFile file in files) { ListViewItem item = new ListViewItem(file.ReturnItem()); fileList.Items.Add(( item )); } }