Endjin.Assembly.ChangeDetection.Infrastructure.ListExtensions.GetMatchingFileByName C# (CSharp) Method

GetMatchingFileByName() public static method

public static GetMatchingFileByName ( this queries, string fileName ) : string
queries this
fileName string
return string
        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;
        }