This is preliminary documentation and subject to change. To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!
IComponent.Dispose
When implemented by a class, disposes of the IComponent.
[Visual Basic]
Sub Dispose()
[C#]
void Dispose();
[C++]
void Dispose() = 0;
[JScript]
function Dispose();
Remarks
The implementation of Dispose must:
Remove any references to other components. Typically, this can be accomplished by assigning a null reference object to any field that contains references to other components.
Release any system resources that are associated with the component, such as file handles, window handles, or database connections.
Dispose of any child components, such as child windows or submenu items, by calling the Dispose method of those components.
Remove the component from its container. If the component has a site, the component must remove itself from its container.
Raise the component's Dispose event.
Ideally, a call to Dispose will cause the component to revert to its initial state, as it was immediately after it was created. However, this is not a requirement. Following a call to the Dispose method, a component is permitted to raise exceptions for operations that it cannot meaningfully perform.