Search Results for

    Show / Hide Table of Contents

    Class TimeoutTimer

    A thread-safe class for running timeouts on asynchronous methods.

    Inheritance
    System.Object
    TimeoutTimer
    Implements
    ITimeoutTimer
    Namespace: FM.LiveSwitch
    Assembly: FM.LiveSwitch.dll
    Syntax
    public class TimeoutTimer : object, ITimeoutTimer

    Constructors

    TimeoutTimer(Action1<Object>, Object)

    Initializes a new instance of the TimeoutTimer class.

    Declaration
    public TimeoutTimer(Action1<object> callback, object state)
    Parameters
    Type Name Description
    Action1<System.Object> callback

    The callback to invoke if the timeout occurs.

    System.Object state

    The state to pass into the callback if the timeout occurs.

    Methods

    Start(Int32)

    Starts the timer.

    Declaration
    public void Start(int timeout)
    Parameters
    Type Name Description
    System.Int32 timeout

    The timeout length, in milliseconds.

    Stop()

    Stops the timer, notifying the calling code if the timeout has already elapsed.

    Declaration
    public bool Stop()
    Returns
    Type Description
    System.Boolean

    true if the timer was successfully stopped in time; false if the timeout elapsed and the timeout callback has been invoked.

    Implements

    ITimeoutTimer
    In This Article
    Back to top Copyright © LiveSwitch Inc. All Rights Reserved. Doc build for LiveSwitch v1.15.0