C# Class System.ComponentModel.Container

Container class: encapsulates components.
Inheritance: IContainer, IDisposable
Mostra file Open project: dotnet/corefx Class Usage Examples

Public Methods

Method Description
Add ( IComponent component ) : void

Adds the specified component to the . The component is unnamed.

Add ( IComponent component, String name ) : void

Adds the specified component to the and assigns a name to it.

Dispose ( ) : void

Disposes of the .

Remove ( IComponent component ) : void

Removes a component from the .

Protected Methods

Method Description
CreateSite ( IComponent component, string name ) : ISite

Creates a Site for the given and assigns the given name to the site.

Dispose ( bool disposing ) : void
GetService ( Type service ) : object

[To be supplied.]

RemoveWithoutUnsiting ( IComponent component ) : void
ValidateName ( IComponent component, string name ) : void

Validates that the given name is valid for a component. The default implementation verifies that name is either null or unique compared to the names of other components in the container.

Private Methods

Method Description
Remove ( IComponent component, bool preserveSite ) : void

Method Details

Add() public method

Adds the specified component to the . The component is unnamed.

public Add ( IComponent component ) : void
component IComponent
return void

Add() public method

Adds the specified component to the and assigns a name to it.

public Add ( IComponent component, String name ) : void
component IComponent
name String
return void

CreateSite() protected method

Creates a Site for the given and assigns the given name to the site.

protected CreateSite ( IComponent component, string name ) : ISite
component IComponent
name string
return ISite

Dispose() public method

Disposes of the .

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

GetService() protected method

[To be supplied.]

protected GetService ( Type service ) : object
service Type
return object

Remove() public method

Removes a component from the .

public Remove ( IComponent component ) : void
component IComponent
return void

RemoveWithoutUnsiting() protected method

protected RemoveWithoutUnsiting ( IComponent component ) : void
component IComponent
return void

ValidateName() protected method

Validates that the given name is valid for a component. The default implementation verifies that name is either null or unique compared to the names of other components in the container.
protected ValidateName ( IComponent component, string name ) : void
component IComponent
name string
return void