public static string GetMatchingFileByName(this List<FileQuery> queries, string fileName)
{
if (queries == null)
{
throw new ArgumentNullException("queries was null.");
}
if (string.IsNullOrEmpty(fileName))
{
throw new ArgumentException("fileName to filter for was null or empty");
}
string match = null;
foreach (var q in queries)
{
match = q.GetMatchingFileByName(fileName);
if (match != null)
{
break;
}
}
return match;
}