/// <summary> /// Initializes a new instance of FileSearcher class. /// </summary> /// <param name="folder">The start search directory.</param> /// <param name="pattern">The search pattern.</param> /// <param name="handlerOption">Specifies where FilesFound event handlers are executed.</param> /// <exception cref="ArgumentException"></exception> /// <exception cref="ArgumentNullException"></exception> public FileSearcher(string folder, string pattern, ExecuteHandlers handlerOption) { CheckFolder(folder); CheckPattern(pattern); searcher = new FilePatternSearcher(folder, pattern, handlerOption); }
/// <summary> /// Initializes a new instance of FileSearcher class. /// </summary> /// <param name="folder">The start search directory.</param> /// <param name="isValid">The delegate that determines algorithm of file selection.</param> /// <param name="handlerOption">Specifies where FilesFound event handlers are executed.</param> /// <exception cref="ArgumentException"></exception> /// <exception cref="ArgumentNullException"></exception> public FileSearcher(string folder, Func <FileInfo, bool> isValid, ExecuteHandlers handlerOption) { CheckFolder(folder); CheckDelegate(isValid); searcher = new FileDelegateSearcher(folder, isValid, handlerOption); }
/// <summary> /// Initializes a new instance of FileSearcher class. /// </summary> /// <param name="folder">The start search directory.</param> /// <param name="isValid">The delegate that determines algorithm of file selection.</param> /// <param name="tokenSource">Instance of CancellationTokenSource for search process cancellation possibility.</param> /// <param name="handlerOption">Specifies where FilesFound event handlers are executed.</param> /// <param name="suppressOperationCanceledException">Determines whether necessary suppress OperationCanceledException if it possible.</param> /// <exception cref="ArgumentException"></exception> /// <exception cref="ArgumentNullException"></exception> public FileSearcher(string folder, Func <FileInfo, bool> isValid, CancellationTokenSource tokenSource, ExecuteHandlers handlerOption, bool suppressOperationCanceledException) { CheckFolder(folder); CheckDelegate(isValid); CheckTokenSource(tokenSource); searcher = new FileCancellationDelegateSearcher(folder, isValid, tokenSource.Token, handlerOption, suppressOperationCanceledException); this.tokenSource = tokenSource; }
/// <summary> /// Initializes a new instance of FileSearcher class. /// </summary> /// <param name="folder">The start search directory.</param> /// <param name="pattern">The search pattern.</param> /// <param name="tokenSource">Instance of CancellationTokenSource for search process cancellation possibility.</param> /// <param name="handlerOption">Specifies where FilesFound event handlers are executed.</param> /// <param name="suppressOperationCanceledException">Determines whether necessary suppress OperationCanceledException if it possible.</param> /// <exception cref="ArgumentException"></exception> /// <exception cref="ArgumentNullException"></exception> public FileSearcher(string folder, string pattern, CancellationTokenSource tokenSource, ExecuteHandlers handlerOption, bool suppressOperationCanceledException) { CheckFolder(folder); CheckPattern(pattern); CheckTokenSource(tokenSource); searcher = new FileCancellationPatternSearcher(folder, pattern, tokenSource.Token, handlerOption, suppressOperationCanceledException); this.tokenSource = tokenSource; }