Show / Hide Table of Contents

    Class Watcher

    An abstract class for establishing a watcher, that can monitor and signal changes of a resource by raising the Changed event.

    Inheritance
    System.Object
    Watcher
    DataWatcher
    NetWatcher
    Implements
    System.IDisposable
    Namespace: Cuemon.Runtime
    Assembly: Cuemon.Runtime.dll
    Syntax
    public abstract class Watcher : IDisposable

    Constructors

    | Improve this Doc

    Watcher()

    Initializes a new instance of the Watcher class, where the signaling is initiated immediately and hereby followed by a periodic signaling every 2 minutes.

    Declaration
    protected Watcher()
    | Improve this Doc

    Watcher(TimeSpan)

    Initializes a new instance of the Watcher class, where the signaling is initiated immediately.

    Declaration
    protected Watcher(TimeSpan period)
    Parameters
    Type Name Description
    System.TimeSpan period

    The time interval between periodic signaling. Specify negative one (-1) milliseconds to disable periodic signaling.

    | Improve this Doc

    Watcher(TimeSpan, TimeSpan)

    Initializes a new instance of the Watcher class.

    Declaration
    protected Watcher(TimeSpan dueTime, TimeSpan period)
    Parameters
    Type Name Description
    System.TimeSpan dueTime

    A System.TimeSpan representing the amount of time to delay before the Watcher starts signaling. Specify negative one (-1) milliseconds to prevent the signaling from starting. Specify zero (0) to start the signaling immediately.

    System.TimeSpan period

    The time interval between periodic signaling. Specify negative one (-1) milliseconds to disable periodic signaling.

    | Improve this Doc

    Watcher(TimeSpan, TimeSpan, TimeSpan)

    Initializes a new instance of the Watcher class.

    Declaration
    protected Watcher(TimeSpan dueTime, TimeSpan period, TimeSpan dueTimeOnChanged)
    Parameters
    Type Name Description
    System.TimeSpan dueTime

    A System.TimeSpan representing the amount of time to delay before the Watcher starts signaling. Specify negative one (-1) milliseconds to prevent the signaling from starting. Specify zero (0) to start the signaling immediately.

    System.TimeSpan period

    The time interval between periodic signaling. Specify negative one (-1) milliseconds to disable periodic signaling.

    System.TimeSpan dueTimeOnChanged

    The amount of time to postpone a Changed event. Specify zero (0) to disable postponing.

    Properties

    | Improve this Doc

    DueTime

    Gets or sets the System.TimeSpan representing the amount of time to delay before the Watcher starts signaling.

    Declaration
    protected TimeSpan DueTime { get; }
    Property Value
    Type Description
    System.TimeSpan

    A System.TimeSpan representing the amount of time to delay before the Watcher starts signaling.

    | Improve this Doc

    DueTimeOnChanged

    Gets the amount of time to postpone a Changed event.

    Declaration
    protected TimeSpan DueTimeOnChanged { get; }
    Property Value
    Type Description
    System.TimeSpan
    | Improve this Doc

    Period

    Gets the time interval between periodic signaling.

    Declaration
    protected TimeSpan Period { get; }
    Property Value
    Type Description
    System.TimeSpan

    A System.TimeSpan representing the time interval between periodic signaling.

    | Improve this Doc

    UtcLastModified

    Gets time when the resource being monitored was last changed.

    Declaration
    public DateTime UtcLastModified { get; }
    Property Value
    Type Description
    System.DateTime

    The time when the resource being monitored was last changed.

    Remarks

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

    | Improve this Doc

    UtcLastSignaled

    Gets the time when the last signaling occurred.

    Declaration
    public DateTime UtcLastSignaled { get; }
    Property Value
    Type Description
    System.DateTime

    The time when the last signaling occurred.

    Remarks

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

    Methods

    | Improve this Doc

    ChangeSignaling(TimeSpan)

    Changes the signaling timer of the Watcher.

    Declaration
    public void ChangeSignaling(TimeSpan dueTime)
    Parameters
    Type Name Description
    System.TimeSpan dueTime

    A System.TimeSpan representing the amount of time to delay before the Watcher starts signaling. Specify negative one (-1) milliseconds to prevent the signaling from starting. Specify zero (0) to start the signaling immediately.

    | Improve this Doc

    ChangeSignaling(TimeSpan, TimeSpan)

    Changes the signaling timer of the Watcher.

    Declaration
    public virtual void ChangeSignaling(TimeSpan dueTime, TimeSpan period)
    Parameters
    Type Name Description
    System.TimeSpan dueTime

    A System.TimeSpan representing the amount of time to delay before the Watcher starts signaling. Specify negative one (-1) milliseconds to prevent the signaling from starting. Specify zero (0) to start the signaling immediately.

    System.TimeSpan period

    The time interval between periodic signaling. Specify negative one (-1) milliseconds to disable periodic signaling.

    Remarks

    If dueTime is zero (0), the signaling is started immediately. If dueTime is negative one (-1) milliseconds, the signaling is never started; and the underlying timer is disabled, but can be re-enabled by specifying a positive value for dueTime. If period is zero (0) or negative one (-1) milliseconds, and dueTime is positive, the signaling is done once; the periodic behavior of the underlying timer is disabled, but can be re-enabled by specifying a value greater than zero for period.

    | Improve this Doc

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    Declaration
    public void Dispose()
    | Improve this Doc

    Dispose(Boolean)

    Releases unmanaged and - optionally - managed resources.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    true to release both managed and unmanaged resources; false to release only unmanaged resources.

    | Improve this Doc

    HandleSignaling()

    Handles the signaling of this Watcher.

    Declaration
    protected abstract void HandleSignaling()
    | Improve this Doc

    OnChangedRaised()

    Raises the Changed event.

    Declaration
    protected void OnChangedRaised()
    Remarks

    This method raises the Changed event with UtcLastModified and DueTimeOnChanged passed to a new instance of WatcherEventArgs.

    | Improve this Doc

    OnChangedRaised(WatcherEventArgs)

    Raises the Changed event.

    Declaration
    protected virtual void OnChangedRaised(WatcherEventArgs e)
    Parameters
    Type Name Description
    WatcherEventArgs e

    The WatcherEventArgs instance containing the event data.

    | Improve this Doc

    SetUtcLastModified(DateTime)

    Marks the time when a resource being monitored was last changed.

    Declaration
    protected void SetUtcLastModified(DateTime utcLastModified)
    Parameters
    Type Name Description
    System.DateTime utcLastModified

    The time when a resource being monitored was last changed.

    Events

    | Improve this Doc

    Changed

    Occurs when a resource has changed.

    Declaration
    public event EventHandler<WatcherEventArgs> Changed
    Event Type
    Type Description
    System.EventHandler<WatcherEventArgs>

    Implements

    System.IDisposable

    Extension Methods

    ConverterExtensions.ParseWith<TSource, TResult>(TSource, Func<TSource, TResult>)
    ConverterExtensions.ParseWith<TSource, T, TResult>(TSource, Func<TSource, T, TResult>, T)
    ConverterExtensions.ParseWith<TSource, T1, T2, TResult>(TSource, Func<TSource, T1, T2, TResult>, T1, T2)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, TResult>(TSource, Func<TSource, T1, T2, T3, TResult>, T1, T2, T3)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, TResult>(TSource, Func<TSource, T1, T2, T3, T4, TResult>, T1, T2, T3, T4)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, TResult>, T1, T2, T3, T4, T5)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, TResult>, T1, T2, T3, T4, T5, T6)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, TResult>, T1, T2, T3, T4, T5, T6, T7)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, T8, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, T8, TResult>, T1, T2, T3, T4, T5, T6, T7, T8)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>, T1, T2, T3, T4, T5, T6, T7, T8, T9)
    ConverterExtensions.As<TResult>(Object)
    ConverterExtensions.As<TResult>(Object, TResult)
    ConverterExtensions.As<TResult>(Object, TResult, IFormatProvider)
    DelegateUtilityExtensions.Wrap<TResult>(TResult)
    DelegateUtilityExtensions.DynamicWrap<TResult>(TResult)
    TweakerExtensions.Adjust<T>(T, Func<T, T>)
    TypeUtilityExtensions.Is<T>(Object)
    TypeUtilityExtensions.IsNot<T>(Object)
    TypeUtilityExtensions.IsNullable<T>(T)
    WrapperExtensions.UseWrapper<T>(T, Action<IDictionary<String, Object>>)
    WrapperExtensions.UseWrapper<T>(T, MemberInfo, Action<IDictionary<String, Object>>)
    EnumerableUtilityExtensions.Yield<TSource>(TSource)
    HashUtilityExtensions.ComputeHash(Object, Action<HashOptions>)
    HmacUtilityExtensions.ComputeKeyedHash(Object, Byte[], Action<KeyedHashOptions>)
    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX