Table of Contents

Class PollingFilesMonitor

Namespace
Azure.Iot.Operations.Connector.Files.FilesMonitor
Assembly
Azure.Iot.Operations.Connector.dll

An implementation of IFilesMonitor that relies on the polling the state of the file system rather than listening for notifications from the operating system.

public class PollingFilesMonitor : IFilesMonitor
Inheritance
PollingFilesMonitor
Implements
Inherited Members

Constructors

PollingFilesMonitor(TimeSpan?)

public PollingFilesMonitor(TimeSpan? pollingInterval = null)

Parameters

pollingInterval TimeSpan?

Methods

Start(string, string?)

Start monitoring the provided directory and/or file.

public void Start(string directory, string? fileName = null)

Parameters

directory string

The directory to monitor.

fileName string

Stop()

Stop monitoring the provided directory and/or file

public void Stop()

Events

OnFileChanged

Event that executes every time the monitored directory and/or file has been created, updated, or deleted with information about what kind of change it was and what file it was that changed.

public event EventHandler<FileChangedEventArgs>? OnFileChanged

Event Type

EventHandler<FileChangedEventArgs>