Table of Contents

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
Object
FileWatcher
Implements
IDisposable
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 String

The file to monitor, in standard or Universal Naming Convention (UNC) notation.

readFile Boolean

if set to true the file specified in path 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

String

The checksum that is associated with the file specified in Path.

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()

Returns

Task

See Also