Search Results for

    Show / Hide Table of Contents

    Class ScheduledItem<TAbsolute>

    Abstract base class for scheduled work items.

    Inheritance
    Object
    ScheduledItem<TAbsolute>
    ScheduledItem<TAbsolute, TValue>
    Implements
    IScheduledItem<TAbsolute>
    IComparable<ScheduledItem<TAbsolute>>
    Inherited Members
    Object.Equals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Object.ToString()
    Object.ReferenceEquals(Object, Object)
    Namespace: System.Reactive.Concurrency
    Assembly: System.Reactive.Core.dll
    Syntax
    public abstract class ScheduledItem<TAbsolute> : IScheduledItem<TAbsolute>, IComparable<ScheduledItem<TAbsolute>> where TAbsolute : IComparable<TAbsolute>
    Type Parameters
    Name Description
    TAbsolute

    Absolute time representation type.

    Constructors

    | Improve this Doc View Source

    ScheduledItem(TAbsolute, IComparer<TAbsolute>)

    Creates a new scheduled work item to run at the specified time.

    Declaration
    protected ScheduledItem(TAbsolute dueTime, IComparer<TAbsolute> comparer)
    Parameters
    Type Name Description
    TAbsolute dueTime

    Absolute time at which the work item has to be executed.

    IComparer<TAbsolute> comparer

    Comparer used to compare work items based on their scheduled time.

    Exceptions
    Type Condition
    ArgumentNullException

    comparer is null.

    Properties

    | Improve this Doc View Source

    DueTime

    Gets the absolute time at which the item is due for invocation.

    Declaration
    public TAbsolute DueTime { get; }
    Property Value
    Type Description
    TAbsolute
    | Improve this Doc View Source

    IsCanceled

    Gets whether the work item has received a cancellation request.

    Declaration
    public bool IsCanceled { get; }
    Property Value
    Type Description
    Boolean

    Methods

    | Improve this Doc View Source

    Cancel()

    Cancels the work item by disposing the resource returned by InvokeCore as soon as possible.

    Declaration
    public void Cancel()
    | Improve this Doc View Source

    CompareTo(ScheduledItem<TAbsolute>)

    Compares the work item with another work item based on absolute time values.

    Declaration
    public int CompareTo(ScheduledItem<TAbsolute> other)
    Parameters
    Type Name Description
    ScheduledItem<TAbsolute> other

    Work item to compare the current work item to.

    Returns
    Type Description
    Int32

    Relative ordering between this and the specified work item.

    Remarks

    The inequality operators are overloaded to provide results consistent with the IComparable implementation. Equality operators implement traditional reference equality semantics.

    | Improve this Doc View Source

    Equals(Object)

    Determines whether a ScheduledItem<TAbsolute> object is equal to the specified object.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj

    The object to compare to the current ScheduledItem<TAbsolute> object.

    Returns
    Type Description
    Boolean

    true if the obj parameter is a ScheduledItem<TAbsolute> object and is equal to the current ScheduledItem<TAbsolute> object; otherwise, false.

    Overrides
    Object.Equals(Object)
    | Improve this Doc View Source

    GetHashCode()

    Returns the hash code for the current ScheduledItem<TAbsolute> object.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    A 32-bit signed integer hash code.

    Overrides
    Object.GetHashCode()
    | Improve this Doc View Source

    Invoke()

    Invokes the work item.

    Declaration
    public void Invoke()
    | Improve this Doc View Source

    InvokeCore()

    Implement this method to perform the work item invocation, returning a disposable object for deep cancellation.

    Declaration
    protected abstract IDisposable InvokeCore()
    Returns
    Type Description
    IDisposable

    Disposable object used to cancel the work item and/or derived work items.

    Operators

    | Improve this Doc View Source

    Equality(ScheduledItem<TAbsolute>, ScheduledItem<TAbsolute>)

    Determines whether two specified ScheduledItem<TAbsolute, TValue> objects are equal.

    Declaration
    public static bool operator ==(ScheduledItem<TAbsolute> left, ScheduledItem<TAbsolute> right)
    Parameters
    Type Name Description
    ScheduledItem<TAbsolute> left

    The first object to compare.

    ScheduledItem<TAbsolute> right

    The second object to compare.

    Returns
    Type Description
    Boolean

    true if both ScheduledItem<TAbsolute, TValue> are equal; otherwise, false.

    Remarks

    This operator does not provide results consistent with the IComparable implementation. Instead, it implements reference equality.

    | Improve this Doc View Source

    GreaterThan(ScheduledItem<TAbsolute>, ScheduledItem<TAbsolute>)

    Determines whether one specified ScheduledItem<TAbsolute> object is due after a second specified ScheduledItem<TAbsolute> object.

    Declaration
    public static bool operator>(ScheduledItem<TAbsolute> left, ScheduledItem<TAbsolute> right)
    Parameters
    Type Name Description
    ScheduledItem<TAbsolute> left

    The first object to compare.

    ScheduledItem<TAbsolute> right

    The second object to compare.

    Returns
    Type Description
    Boolean

    true if the DueTime value of left is later than the DueTime value of right; otherwise, false.

    Remarks

    This operator provides results consistent with the IComparable implementation.

    | Improve this Doc View Source

    GreaterThanOrEqual(ScheduledItem<TAbsolute>, ScheduledItem<TAbsolute>)

    Determines whether one specified ScheduledItem<TAbsolute> object is due after or at the same time of a second specified ScheduledItem<TAbsolute> object.

    Declaration
    public static bool operator >=(ScheduledItem<TAbsolute> left, ScheduledItem<TAbsolute> right)
    Parameters
    Type Name Description
    ScheduledItem<TAbsolute> left

    The first object to compare.

    ScheduledItem<TAbsolute> right

    The second object to compare.

    Returns
    Type Description
    Boolean

    true if the DueTime value of left is later than or simultaneous with the DueTime value of right; otherwise, false.

    Remarks

    This operator provides results consistent with the IComparable implementation.

    | Improve this Doc View Source

    Inequality(ScheduledItem<TAbsolute>, ScheduledItem<TAbsolute>)

    Determines whether two specified ScheduledItem<TAbsolute, TValue> objects are inequal.

    Declaration
    public static bool operator !=(ScheduledItem<TAbsolute> left, ScheduledItem<TAbsolute> right)
    Parameters
    Type Name Description
    ScheduledItem<TAbsolute> left

    The first object to compare.

    ScheduledItem<TAbsolute> right

    The second object to compare.

    Returns
    Type Description
    Boolean

    true if both ScheduledItem<TAbsolute, TValue> are inequal; otherwise, false.

    Remarks

    This operator does not provide results consistent with the IComparable implementation. Instead, it implements reference equality.

    | Improve this Doc View Source

    LessThan(ScheduledItem<TAbsolute>, ScheduledItem<TAbsolute>)

    Determines whether one specified ScheduledItem<TAbsolute> object is due before a second specified ScheduledItem<TAbsolute> object.

    Declaration
    public static bool operator <(ScheduledItem<TAbsolute> left, ScheduledItem<TAbsolute> right)
    Parameters
    Type Name Description
    ScheduledItem<TAbsolute> left

    The first object to compare.

    ScheduledItem<TAbsolute> right

    The second object to compare.

    Returns
    Type Description
    Boolean

    true if the DueTime value of left is earlier than the DueTime value of right; otherwise, false.

    Remarks

    This operator provides results consistent with the IComparable implementation.

    | Improve this Doc View Source

    LessThanOrEqual(ScheduledItem<TAbsolute>, ScheduledItem<TAbsolute>)

    Determines whether one specified ScheduledItem<TAbsolute> object is due before or at the same of a second specified ScheduledItem<TAbsolute> object.

    Declaration
    public static bool operator <=(ScheduledItem<TAbsolute> left, ScheduledItem<TAbsolute> right)
    Parameters
    Type Name Description
    ScheduledItem<TAbsolute> left

    The first object to compare.

    ScheduledItem<TAbsolute> right

    The second object to compare.

    Returns
    Type Description
    Boolean

    true if the DueTime value of left is earlier than or simultaneous with the DueTime value of right; otherwise, false.

    Remarks

    This operator provides results consistent with the IComparable implementation.

    Implements

    IScheduledItem<TAbsolute>
    System.IComparable<T>
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX