DirectoryEnumerationFilters Class |
Inheritance Hierarchy SystemObject Alphaleonis.Win32.FilesystemDirectoryEnumerationFilters
Namespace:
Alphaleonis.Win32.Filesystem
Assembly:
AlphaFS (in AlphaFS.dll) Version: 2.2
Syntax public class DirectoryEnumerationFilters
Public Class DirectoryEnumerationFilters
public ref class DirectoryEnumerationFilters
type DirectoryEnumerationFilters = class end
The DirectoryEnumerationFilters type exposes the following members.
Constructors Properties
| Name | Description |
---|
| CancellationToken | Gets or sets the cancellation token to abort the enumeration. |
| ErrorFilter | Gets or sets the filter that returns if the input error should not be thrown. |
| InclusionFilter | Gets or sets the filter that returns if the input file system entry should be included in the enumeration. |
| RecursionFilter | Gets or sets the filter that returns if the input directory should be recursively traversed. |
TopMethods
| Name | Description |
---|
| Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
| GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
| GetType | Gets the Type of the current instance. (Inherited from Object.) |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
| ToString | Returns a string that represents the current object. (Inherited from Object.) |
TopRemarks 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