private static bool CheckFileNameUsingPaths(string fileName, StringCollection paths, out string fullFileName)
{
fullFileName = null;
string str = fileName.Trim(new char[] { '"' });
FileInfo info = new FileInfo(str);
if (str.Length != info.Name.Length)
{
if (info.Exists)
{
fullFileName = info.FullName;
}
return info.Exists;
}
using (StringEnumerator enumerator = paths.GetEnumerator())
{
while (enumerator.MoveNext())
{
string str3 = enumerator.Current + Path.DirectorySeparatorChar + str;
FileInfo info2 = new FileInfo(str3);
if (info2.Exists)
{
fullFileName = str3;
return true;
}
}
}
return false;
}