public interface IComponent
The IComponent interface represents a component. To be a component, a class must implement IComponent. Components can be hosted in containers. For each component in a container, the container creates a site that acts as a binding link between the component and the container.
Methods
Name | Description |
---|---|
addOnDispose(EventHandler value) | Adds an OnDispose event handler. |
dispose() | Disposes a component. |
getChildOf(IComponent component) | Checks if this component is a child of the specified component. |
getSite() | Returns the site of this component. |
removeOnDispose(EventHandler value) | Removes an OnDispose event handler. |
setSite(ISite value) | Sets the site of this component. |
Adds an OnDispose event handler. The OnDispose event is fired when the component's dispose() method is called. Components that maintain references to other components can register OnDispose event handlers for the referenced components so that the references can be cleared when the components are disposed.
Disposes a component. A call to dispose() indicates that the user of the component has no further need for the component. An implementation of dispose() must:
Ideally, a call to dispose() will revert a component to the state it was in immediately after it was created. This is, however, not a requirement. Following a call to dispose(), a component is permitted to raise exceptions for operations that cannot meaningfully be performed.
Checks if this component is a child of the specified component. A component is considered a child of a specified parent component if the parent component's implementation of the dispose() method also disposes the child component. Examples of child components are child windows and submenus.
Returns the site of this component. The value returned must be the value that was passed to the most recent call to setSite(), or null if no calls have been made to setSite().
Removes an OnDispose event handler.
Sets the site of this component. A non-null value indicates that the component has been added to a container; a null value indicates that the component is being removed from a container. An implementation of setSite() is required to store the specified value and return the same value from subsequent calls to getSite().