Gets or sets a lambda function that may be used to further restrict
the set of matched files.
Namespace: CleanCode.GeneralComponents.ControlsAssembly: CleanCode.GeneralComponents (in CleanCode.GeneralComponents.dll) Version: 1.2.3.0 (1.2.03)
public FileMask..::..RestrictionLambdaDelegate RestrictionLambda { get; set; }
Public Property RestrictionLambda As FileMask..::..RestrictionLambdaDelegate
Get
Set
public:
property FileMask..::..RestrictionLambdaDelegate^ RestrictionLambda {
FileMask..::..RestrictionLambdaDelegate^ get ();
void set (FileMask..::..RestrictionLambdaDelegate^ value);
}
Field Value
The restriction lambda.
This callback function lets you add constraints beyond just matching file names
as you can do with wildcards.
You could, for example, restrict any files matched by the
Mask value
to also be after a certain date by specifying a lambda function like this:
fileMask.RestrictionLambda =
f => DateTime.Compare(File.GetLastWriteTime(f), MyEarliestDateAllowed) >= 0;
fileMask.RestrictionLambda =
f => DateTime.Compare(File.GetLastWriteTime(f), MyEarliestDateAllowed) >= 0;
You may use arbitrarily complex expressions but, ultimately, your function must return a
Boolean value indicating whether the file should be included or not.
Thus, in the example given, the possible
Compare(DateTime, DateTime) return values
of (-1, 0, or 1) are mapped to (true, false) with the inequality shown.