internal bool ShouldFileSync(string localFile) { if (SelectedFolders == null) { return(true); } var dir = Path.GetDirectoryName(localFile).ToLowerInvariant(); dir = dir.Replace(LocalFolder.ToLowerInvariant(), string.Empty).TrimStart('\\') + "\\"; if (SelectedFolders.Count(p => !string.IsNullOrEmpty(p) && dir.StartsWith(p, StringComparison.OrdinalIgnoreCase)) > 0) { return(true); } return(false); }