public bool PathShouldBeExcluded(string path)
{
if (this.configFile != null)
{
string[] pathFolderNames = path
.Split(new char[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries);
foreach (string pathToExclude in this.configFile.ExcludeFolders)
{
if (path.ToLower().StartsWith(pathToExclude.ToLower()))
return true;
if (pathFolderNames.Contains(pathToExclude, StringComparer.InvariantCultureIgnoreCase))
return true;
}
}
return false;
}