Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​ComponentModel.​Container
Assembly: System.ComponentModel.TypeConverter
Inheritance: object → Container
Implemented Interfaces
- IContainer (Inherits: IDisposable)
Encapsulates zero or more components.
Properties
public
ComponentCollection
Components
Gets all the components in the <see cref="T:System.ComponentModel.Container" /> .
Methods
public
void
Add​(IComponent component)
Adds the specified <see cref="T:System.ComponentModel.Component" /> to the <see cref="T:System.ComponentModel.Container" /> . The component is unnamed.
component
The component to add.
public
void
Add​(IComponent component,
string name)
Adds the specified <see cref="T:System.ComponentModel.Component" /> to the <see cref="T:System.ComponentModel.Container" /> and assigns it a name.
component
The component to add.
name
The unique, case-insensitive name to assign to the component.
-or-
<see langword="null" /> , which leaves the component unnamed.
protected
ISite
CreateSite​(IComponent component,
string name)
Creates a site <see cref="T:System.ComponentModel.ISite" /> for the given <see cref="T:System.ComponentModel.IComponent" /> and assigns the given name to the site.
Returns The newly created site.
component
The <see cref="T:System.ComponentModel.IComponent" /> to create a site for.
name
The name to assign to <paramref name="component" /> , or <see langword="null" /> to skip the name assignment.
public
void
Dispose​()
Releases all resources used by the <see cref="T:System.ComponentModel.Container" /> .
protected
void
Dispose​(bool disposing)
Releases the unmanaged resources used by the <see cref="T:System.ComponentModel.Container" /> , and optionally releases the managed resources.
disposing
<see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.
protected
void
Finalize​()
Releases unmanaged resources and performs other cleanup operations before the <see cref="T:System.ComponentModel.Container" /> is reclaimed by garbage collection.
protected
object
GetService​(Type service)
Gets the service object of the specified type, if it is available.
Returns An <see cref="T:System.Object" /> implementing the requested service, or <see langword="null" /> if the service cannot be resolved.
service
The <see cref="T:System.Type" /> of the service to retrieve.
public
void
Remove​(IComponent component)
Removes a component from the <see cref="T:System.ComponentModel.Container" /> .
component
The component to remove.
protected
void
RemoveWithoutUnsiting​(IComponent component)
Removes a component from the <see cref="T:System.ComponentModel.Container" /> without setting <see cref="P:System.ComponentModel.IComponent.Site" /> to <see langword="null" /> .
component
The component to remove.
protected
void
ValidateName​(IComponent component,
string name)
Determines whether the component name is unique for this container.
component
The named component.
name
The component name to validate.
public
bool
Equals​(object obj)
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object