protected override void OnSearchCreating(FileSystemSearch search) { search.DisallowEnumeration = !Options.DryRun; search.MatchPartOnly = true; base.OnSearchCreating(search); }
protected override void OnSearchCreating(FileSystemSearch search) { if (Options.SearchTarget != SearchTarget.Files && !Options.StructureOnly) { search.CanRecurseMatch = false; } }
protected override FileSystemSearch CreateSearch() { FileSystemSearch search = base.CreateSearch(); search.DisallowEnumeration = !Options.DryRun; search.MatchPartOnly = true; return(search); }
public void M() { var regex = new Regex("pattern", RegexOptions.IgnoreCase); var name = new Filter(regex); var filter = new FileSystemFilter(name); var searchOptions = new FileSystemSearchOptions(recurseSubdirectories: false); var search = new FileSystemSearch(filter, options: searchOptions); search.Replace("directoryPath", ReplaceOptions.Empty); }
private FileSystemSearch CreateSearch() { var filter = new FileSystemFilter( name: Options.NameFilter, part: Options.NamePart, extension: Options.ExtensionFilter, content: Options.ContentFilter, properties: Options.FilePropertyFilter, attributes: Options.Attributes, attributesToSkip: Options.AttributesToSkip, emptyOption: Options.EmptyOption); NameFilter?directoryFilter = null; if (Options.DirectoryFilter != null) { directoryFilter = new NameFilter( name: Options.DirectoryFilter, part: Options.DirectoryNamePart); } var options = new FileSystemSearchOptions( searchTarget: Options.SearchTarget, recurseSubdirectories: Options.RecurseSubdirectories, defaultEncoding: Options.DefaultEncoding); var search = new FileSystemSearch( filter: filter, directoryFilter: directoryFilter, searchProgress: ProgressReporter, options: options); OnSearchCreating(search); return(search); }
protected virtual void OnSearchCreating(FileSystemSearch search) { }
protected override void OnSearchCreating(FileSystemSearch search) { search.CanRecurseMatch = true; }