Class TimeoutTimer
A thread-safe class for running timeouts on asynchronous methods.
Inheritance
System.Object
TimeoutTimer
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class TimeoutTimer : 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 |
|