Click or drag to resize

DirectoryEnumerationFilters Class

[AlphaFS] Specifies a set of custom filters to be used with enumeration methods of Directory, e.g., EnumerateDirectories(String), EnumerateFiles(String), or EnumerateFileSystemEntries(String).
Inheritance Hierarchy
SystemObject
  Alphaleonis.Win32.FilesystemDirectoryEnumerationFilters

Namespace:  Alphaleonis.Win32.Filesystem
Assembly:  AlphaFS (in AlphaFS.dll) Version: 2.2
Syntax
public class DirectoryEnumerationFilters

The DirectoryEnumerationFilters type exposes the following members.

Constructors
  NameDescription
Public methodDirectoryEnumerationFilters
Initializes a new instance of the DirectoryEnumerationFilters class
Top
Properties
  NameDescription
Public propertyCancellationToken
Gets or sets the cancellation token to abort the enumeration.
Public propertyErrorFilter
Gets or sets the filter that returns if the input error should not be thrown.
Public propertyInclusionFilter
Gets or sets the filter that returns if the input file system entry should be included in the enumeration.
Public propertyRecursionFilter
Gets or sets the filter that returns if the input directory should be recursively traversed.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks
DirectoryEnumerationFilters allows scenarios in which files/directories being enumerated by the methods of Directory class are accepted only if they match the search pattern, attributes (see SkipReparsePoints), and optionally also the custom criteria tested in the method whose delegate is specified in InclusionFilter. These criteria could be, e.g., file size exceeding some threshold, pathname matches a compex regular expression, etc. If the enumeration process is set to be recursive (see Recursive) and RecursionFilter is specified, the directory is traversed recursively only if it matches the custom criteria in RecursionFilter method. This allows, for example, custom handling of junctions and symbolic links, e.g., detection of cycles. If any error occurs during the enumeration and the enumeration process is not set to ignore errors (see ContinueOnException), an exception is thrown unless the error is handled (filtered out) by the method specified in ErrorFilter (if specified). The method may, for example, consume the error by reporting it in a log, so that the enumeration continues as in the case of ContinueOnException option but the user will be informed about errors.
See Also