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.
myNamespace.myClassName.registerClass('myNamespace.myClassName', null, Sys.IDisposable);
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.
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.