I'm using the following function call:
var filesfound = filterSplit.SelectMany(
filter => folder1.GetFiles(
filter,
SearchOption.AllDirectories
)
);
And I'd like to put a conditional statement in there that will change SearchOption.AllDirectories
to SearchOption.TopDirectoryOnly
based on a certain condition (A checkbox checked or not)
Is there a way to do this? (I can't put the entire declaration into an if statement, even with an else option still declaring it, as it doesn't allow me to, saying that filesfound does not exist...)