Class FileWatcher
- Namespace
- Cuemon.Runtime
- Assembly
- Cuemon.Core.dll
Provides a watcher implementation designed to monitor and signal changes applied to a file by raising the Changed event.
public class FileWatcher : Watcher, IWatcher, IDisposable
- Inheritance
-
FileWatcher
- Implements
- Inherited Members
Constructors
FileWatcher(String, Boolean, Action<WatcherOptions>)
Initializes a new instance of the FileWatcher class.
public FileWatcher(string path, bool readFile = false, Action<WatcherOptions> setup = null)
Parameters
path
StringThe file to monitor, in standard or Universal Naming Convention (UNC) notation.
readFile
Booleanif set to
true
the file specified inpath
will be opened and a checksum will be computed using CyclicRedundancyCheck64 algorithm.setup
Action<WatcherOptions>The WatcherOptions which may be configured.
Properties
Checksum
Gets the checksum that is associated with the file specified in Path.
public string Checksum { get; }
Property Value
Remarks
If ReadFile is false
this property will remain null
.
Path
Gets the path of the file to watch.
public string Path { get; }
Property Value
- String
The path to monitor.
ReadFile
Gets a value indicating whether the file specified in Path will be opened, read and assign the computed value to Checksum.
public bool ReadFile { get; }
Property Value
- Boolean
true
if the file specified in Path will be opened, read and assign the computed value to Checksum; otherwise,false
.
UtcCreated
Gets the time, in Coordinated Universal Time (UTC), when this instance was created.
public DateTime UtcCreated { get; }
Property Value
- DateTime
The time, in Coordinated Universal Time (UTC), when this instance was created.
Methods
HandleSignalingAsync()
Handles the signaling of this FileWatcher.
protected override Task HandleSignalingAsync()