The AndFilter class serves the same purpose as a logical-and operator. It states that the items must match all the filters regrouped within the AndFilter class in order to be processed.
Demonstration
Process all the files in folder that contain the TXT extension and that are between 5k and 10k size.
VB.NET | Copy Code |
---|---|
Dim filter As New SizeFilter() |
C# | Copy Code |
---|---|
|
Since the AndFilter is used by default when combining multiple filters, it is not necessary to create an instance of the AndFilter class. Therefore, we can omit the creation of the class. We can also omit creating a NameFilter class since we are using a basic string filter and the NameFilter class is constructed underneath.
VB.NET | Copy Code |
---|---|
|
C# | Copy Code |
---|---|
|