Table of Contents

Class WatcherEventArgs

Namespace
Cuemon.Runtime
Assembly
Cuemon.Core.dll

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

WatcherEventArgs()

Initializes a new instance of the WatcherEventArgs class.

protected WatcherEventArgs()

WatcherEventArgs(DateTime)

Initializes a new instance of the WatcherEventArgs class.

public WatcherEventArgs(DateTime utcLastModified)

Parameters

utcLastModified DateTime

The time when a Watcher last detected changes to a resource.

WatcherEventArgs(DateTime, TimeSpan)

Initializes a new instance of the WatcherEventArgs class.

public WatcherEventArgs(DateTime utcLastModified, TimeSpan delayed)

Parameters

utcLastModified DateTime

The time when a Watcher last detected changes to a resource.

delayed TimeSpan

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

Fields

Empty

Represents an event with no event data.

public static readonly WatcherEventArgs Empty

Field Value

WatcherEventArgs

Properties

Delayed

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

public TimeSpan Delayed { get; }

Property Value

TimeSpan

UtcLastModified

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

public DateTime UtcLastModified { get; }

Property Value

DateTime

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

Remarks

This property is measured in Coordinated Universal Time (UTC) (also known as Greenwich Mean Time).