Timer.Dispose Method (WaitHandle)
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Releases all resources used by the current instance of Timer and signals when the timer has been disposed of.
Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
Public Function Dispose ( _
notifyObject As WaitHandle _
) As Boolean
public bool Dispose(
WaitHandle notifyObject
)
Parameters
- notifyObject
Type: System.Threading.WaitHandle
The WaitHandle to be signaled when the timer has been disposed of.
Return Value
Type: System.Boolean
true if the function succeeds; otherwise, false.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | The notifyObject parameter is nulla null reference (Nothing in Visual Basic). |
Remarks
Calling Dispose makes the resources that are used by the Timer eligible to be reallocated for other purposes.
When this method completes, it signals the WaitHandle specified by the notifyObject parameter. Use this overload of the Dispose method if you want to be able to block until you are certain that the timer has been disposed.
Version Information
Silverlight
Supported in: 5, 4, 3
Silverlight for Windows Phone
Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0
XNA Framework
Supported in: Xbox 360, Windows Phone OS 7.0
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.