Encapsulates zero or more components.
More...
|
virtual void | Add (IComponent component) |
| Adds the specified T:System.ComponentModel.Component to the T:System.ComponentModel.Container. The component is unnamed. More...
|
|
virtual void | Add (IComponent component, string name) |
| Adds the specified T:System.ComponentModel.Component to the T:System.ComponentModel.Container and assigns it a name. More...
|
|
void | Dispose () |
| Releases all resources used by the T:System.ComponentModel.Container. More...
|
|
virtual void | Remove (IComponent component) |
| Removes a component from the T:System.ComponentModel.Container. More...
|
|
|
virtual ISite | CreateSite (IComponent component, string name) |
| Creates a site T:System.ComponentModel.ISite for the given T:System.ComponentModel.IComponent and assigns the given name to the site. More...
|
|
virtual void | Dispose (bool disposing) |
| Releases the unmanaged resources used by the T:System.ComponentModel.Container, and optionally releases the managed resources. More...
|
|
virtual object | GetService (Type service) |
| Gets the service object of the specified type, if it is available. More...
|
|
void | RemoveWithoutUnsiting (IComponent component) |
| Removes a component from the T:System.ComponentModel.Container without setting P:System.ComponentModel.IComponent.Site to null . More...
|
|
virtual void | ValidateName (IComponent component, string name) |
| Determines whether the component name is unique for this container. More...
|
|
Encapsulates zero or more components.
Definition at line 7 of file Container.cs.
◆ Add() [1/2]
virtual void System.ComponentModel.Container.Add |
( |
IComponent |
component | ) |
|
|
virtual |
Adds the specified T:System.ComponentModel.Component to the T:System.ComponentModel.Container. The component is unnamed.
- Parameters
-
component | The component to add. |
- Exceptions
-
T:System.ArgumentNullException | component is null . |
Implements System.ComponentModel.IContainer.
Definition at line 117 of file Container.cs.
◆ Add() [2/2]
virtual void System.ComponentModel.Container.Add |
( |
IComponent |
component, |
|
|
string |
name |
|
) |
| |
|
virtual |
Adds the specified T:System.ComponentModel.Component to the T:System.ComponentModel.Container and assigns it a name.
- Parameters
-
component | The component to add. |
name | The unique, case-insensitive name to assign to the component.-or- null , which leaves the component unnamed. |
- Exceptions
-
T:System.ArgumentNullException | component is null . |
T:System.ArgumentException | name is not unique. |
Implements System.ComponentModel.IContainer.
Definition at line 130 of file Container.cs.
◆ CreateSite()
virtual ISite System.ComponentModel.Container.CreateSite |
( |
IComponent |
component, |
|
|
string |
name |
|
) |
| |
|
protectedvirtual |
Creates a site T:System.ComponentModel.ISite for the given T:System.ComponentModel.IComponent and assigns the given name to the site.
- Parameters
-
component | The T:System.ComponentModel.IComponent to create a site for. |
name | The name to assign to component , or null to skip the name assignment. |
- Returns
- The newly created site.
Reimplemented in System.ComponentModel.NestedContainer.
Definition at line 167 of file Container.cs.
◆ Dispose() [1/2]
void System.ComponentModel.Container.Dispose |
( |
| ) |
|
◆ Dispose() [2/2]
virtual void System.ComponentModel.Container.Dispose |
( |
bool |
disposing | ) |
|
|
protectedvirtual |
Releases the unmanaged resources used by the T:System.ComponentModel.Container, and optionally releases the managed resources.
- Parameters
-
disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
Reimplemented in System.ComponentModel.NestedContainer.
Definition at line 182 of file Container.cs.
◆ GetService()
virtual object System.ComponentModel.Container.GetService |
( |
Type |
service | ) |
|
|
protectedvirtual |
Gets the service object of the specified type, if it is available.
- Parameters
-
service | The T:System.Type of the service to retrieve. |
- Returns
- An T:System.Object implementing the requested service, or
null
if the service cannot be resolved.
Reimplemented in System.ComponentModel.NestedContainer.
Definition at line 203 of file Container.cs.
◆ Remove()
virtual void System.ComponentModel.Container.Remove |
( |
IComponent |
component | ) |
|
|
virtual |
◆ RemoveWithoutUnsiting()
void System.ComponentModel.Container.RemoveWithoutUnsiting |
( |
IComponent |
component | ) |
|
|
protected |
Removes a component from the T:System.ComponentModel.Container without setting P:System.ComponentModel.IComponent.Site to null
.
- Parameters
-
component | The component to remove. |
Definition at line 256 of file Container.cs.
◆ ValidateName()
virtual void System.ComponentModel.Container.ValidateName |
( |
IComponent |
component, |
|
|
string |
name |
|
) |
| |
|
protectedvirtual |
Determines whether the component name is unique for this container.
- Parameters
-
component | The named component. |
name | The component name to validate. |
- Exceptions
-
T:System.ArgumentNullException | component is null . |
T:System.ArgumentException | name is not unique. |
Definition at line 268 of file Container.cs.
◆ Components
Gets all the components in the T:System.ComponentModel.Container.
- Returns
- A collection that contains the components in the T:System.ComponentModel.Container.
Definition at line 71 of file Container.cs.
The documentation for this class was generated from the following file: