Provides a common interface for the application-defined tasks of closing, releasing, or resetting resources held by instances of a registered Microsoft AJAX Library class.
Namespace: Sys
Inherits: None
myNamespace.myClassName.registerClass('myNamespace.myClassName', null, Sys.IDisposable);
- Sys.IDisposable dispose Method
Releases resources held by an object, or prepares an object for reuse.
Implement the IDisposible interface to provide a common interface for closing or releasing resources held by instances of your registered Microsoft AJAX Library class.
You register an interface by when you register the class by calling the Type.registerClass method. You specify IDisposible in the interfaceTypes parameter when you call Type.registerClass.
For more information about registering a class, see Type.registerClass Method.
Note: |
|---|
The Sys.Component base class implements the IDisposible interface. If you create a component class derived from the Sys.Component base class, your class automatically inherits the IDisposible interface implementation. |
The following example shows a class that implements the IDisposible interface. The class definition implements the dispose method. The class is registered by invoking the registerClass method and passing IDisposible in the interfaceTypes parameter. The dispose method of the instance is invoked so that it can release resources, which makes it safe for the code to delete the instance.
Other Resources