Class ExtendedPathFilter
ExtendedPathFilter filters based on name, file size, and the last write time of the file.
Implements
Inherited Members
Namespace: ICSharpCode.SharpZipLib.Core
Assembly: ICSharpCode.SharpZipLib.dll
Syntax
public class ExtendedPathFilter : PathFilter, IScanFilter
Remarks
Provides an example of how to customise filtering.
Constructors
| Improve this Doc View SourceExtendedPathFilter(String, DateTime, DateTime)
Initialise a new instance of ExtendedPathFilter.
Declaration
public ExtendedPathFilter(string filter, DateTime minDate, DateTime maxDate)
Parameters
Type | Name | Description |
---|---|---|
System.String | filter | The filter to apply. |
System.DateTime | minDate | The minimum System.DateTime to include. |
System.DateTime | maxDate | The maximum System.DateTime to include. |
ExtendedPathFilter(String, Int64, Int64)
Initialise a new instance of ExtendedPathFilter.
Declaration
public ExtendedPathFilter(string filter, long minSize, long maxSize)
Parameters
Type | Name | Description |
---|---|---|
System.String | filter | The filter to apply. |
System.Int64 | minSize | The minimum file size to include. |
System.Int64 | maxSize | The maximum file size to include. |
ExtendedPathFilter(String, Int64, Int64, DateTime, DateTime)
Initialise a new instance of ExtendedPathFilter.
Declaration
public ExtendedPathFilter(string filter, long minSize, long maxSize, DateTime minDate, DateTime maxDate)
Parameters
Type | Name | Description |
---|---|---|
System.String | filter | The filter to apply. |
System.Int64 | minSize | The minimum file size to include. |
System.Int64 | maxSize | The maximum file size to include. |
System.DateTime | minDate | The minimum System.DateTime to include. |
System.DateTime | maxDate | The maximum System.DateTime to include. |
Properties
| Improve this Doc View SourceMaxDate
Get/set the maximum System.DateTime value that will match for this filter.
Declaration
public DateTime MaxDate { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime |
Remarks
Files with a LastWrite time greater than this value are excluded by the filter.
MaxSize
Get/set the maximum size/length for a file that will match this filter.
Declaration
public long MaxSize { get; set; }
Property Value
Type | Description |
---|---|
System.Int64 |
Remarks
The default value is System.Int64.MaxValue
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | value is less than zero or less than MinSize |
MinDate
Get/set the minimum System.DateTime value that will match for this filter.
Declaration
public DateTime MinDate { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime |
Remarks
Files with a LastWrite time less than this value are excluded by the filter.
MinSize
Get/set the minimum size/length for a file that will match this filter.
Declaration
public long MinSize { get; set; }
Property Value
Type | Description |
---|---|
System.Int64 |
Remarks
The default value is zero.
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | value is less than zero; greater than MaxSize |
Methods
| Improve this Doc View SourceIsMatch(String)
Test a filename to see if it matches the filter.
Declaration
public override bool IsMatch(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The filename to test. |
Returns
Type | Description |
---|---|
System.Boolean | True if the filter matches, false otherwise. |
Overrides
Exceptions
Type | Condition |
---|---|
System.IO.FileNotFoundException | The |