C# Class FileSystem.FileMonitor

Monitors a file for changes. It uses the FileSystemWatcher and debounce the events to make sure only one event is fired for a change of a file. Note: If a file is used in different contexts than FileMonitor will fire for each context.
Inheritance: IFileMonitor
Afficher le fichier Open project: Helmut-Ortmann/EnterpriseArchitect_hoTools Class Usage Examples

Méthodes publiques

Méthode Description
FileMonitor ( string filePath ) : System

Parameterize FileSystemWatcher

Start ( ) : void

Start Watching the file

Stop ( ) : void

Stop watching the file

Update ( string filePath ) : void

Update the fileName to watch for changes

Private Methods

Méthode Description
FindReadyPaths ( DateTime>.Dictionary events ) : List

Return list of files which haven't received an change event for TIME_WITOUT_EVENT_MS.

FireEvent ( string path ) : void
OnChange ( object sender, FileSystemEventArgs e ) : void

OnChange Event from System FileSystemWatcher after file has changed. It enters all events with the last event time in the pending event list.

OnFileError ( object o, ErrorEventArgs e ) : void

Handle error from FileSystemWatcher

OnTimeout ( object state ) : void

Timeout

Method Details

FileMonitor() public méthode

Parameterize FileSystemWatcher
public FileMonitor ( string filePath ) : System
filePath string
Résultat System

Start() public méthode

Start Watching the file
public Start ( ) : void
Résultat void

Stop() public méthode

Stop watching the file
public Stop ( ) : void
Résultat void

Update() public méthode

Update the fileName to watch for changes
public Update ( string filePath ) : void
filePath string
Résultat void