I'm trying to use my FileWorks class below to tell me if a directory has a certain file extension.
I'm trying to be as generic as possible and reuse the function...
I'm not sure how to approach this one. This is the code I have below.
Does not look like it would work if I were to call it...
FileWorks filework = new FileWorks();
How can I pass the bool result back accross soo many functions?
public class FileWorks
bool CheckDirectoryForFilesWithExtension(FileInfo fi)
if (fi.Extension == "tif")
public void GetFilesDoSomething(string DirName, Action<FileInfo> method)
DirectoryInfo d = new DirectoryInfo(DirName);
FileInfo f = d.GetFiles();
foreach (FileInfo fi in f)