Table of Contents

WatcherEventArgs Class

Definition

Namespace
Cuemon.Runtime
Assemblies
Cuemon.Core.dll
Source
src/Cuemon.Core/Runtime/WatcherEventArgs.cs

Provides data for watcher related operations.

public class WatcherEventArgs : EventArgs
Inheritance
WatcherEventArgs

Examples

The following example shows the information a watcher passes along when a resource change is raised.

using System;
using Cuemon.Runtime;

namespace MyApp.Examples;

public static class WatcherEventArgsExample
{
    public static void Demonstrate()
    {
        var immediate = new WatcherEventArgs(DateTime.UtcNow);
        var postponed = new WatcherEventArgs(DateTime.UtcNow.AddSeconds(-5), TimeSpan.FromMilliseconds(250));
        var empty = WatcherEventArgs.Empty;

        Console.WriteLine(immediate.UtcLastModified.Kind);
        Console.WriteLine(postponed.Delayed.TotalMilliseconds);
        Console.WriteLine(empty.UtcLastModified == DateTime.MinValue);
    }
}

Constructors

Name Description
WatcherEventArgs()

Initializes a new instance of the WatcherEventArgs class.

WatcherEventArgs(DateTime)

Initializes a new instance of the WatcherEventArgs class.

WatcherEventArgs(DateTime, TimeSpan)

Initializes a new instance of the WatcherEventArgs class.

Fields

Name Description
Empty

Represents an event with no event data.

Properties

Name Description
Delayed

Gets the time a Watcher was intentionally delayed before signaling changes to a resource.

UtcLastModified

Gets the time when a watcher last detected changes to a resource, or a MinValue if an empty event.