Interface IDirectoryScanListener
Interface for objects wishing to receive a 'call-back' from a DirectoryScanJob
public interface IDirectoryScanListener
Remarks
Implementations can be provided to DirectoryScanJob in two ways:
- Via dependency injection (recommended): Register the implementation in the DI container. The job will resolve it by type name specified via DirectoryScanListenerName.
- Via SchedulerContext (legacy): Store the instance in the SchedulerContext with a key matching the value specified in DirectoryScanListenerName.
Methods
FilesDeleted(IReadOnlyCollection<FileInfo>, CancellationToken)
ValueTask FilesDeleted(IReadOnlyCollection<FileInfo> deletedFiles, CancellationToken cancellationToken = default)
Parameters
deletedFilesIReadOnlyCollection<FileInfo>An array of FileInfo objects that were deleted since the last scan of the directory
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
FilesUpdatedOrAdded(IReadOnlyCollection<FileInfo>, CancellationToken)
ValueTask FilesUpdatedOrAdded(IReadOnlyCollection<FileInfo> updatedFiles, CancellationToken cancellationToken = default)
Parameters
updatedFilesIReadOnlyCollection<FileInfo>An array of FileInfo objects that were updated/added since the last scan of the directory
cancellationTokenCancellationTokenThe cancellation instruction.