Container Class
TOC
Collapse the table of content
Expand the table of content

Container Class

 

Encapsulates zero or more components.

Namespace:   System.ComponentModel
Assembly:  System (in System.dll)

System.Object
  System.ComponentModel.Container
    System.ComponentModel.NestedContainer

[HostProtectionAttribute(SecurityAction.LinkDemand, SharedState = true)]
public class Container : IContainer, IDisposable

NameDescription
System_CAPS_pubmethodContainer()

Initializes a new instance of the Container class.

NameDescription
System_CAPS_pubpropertyComponents

Gets all the components in the Container.

NameDescription
System_CAPS_pubmethodAdd(IComponent)

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

System_CAPS_pubmethodAdd(IComponent, String)

Adds the specified Component to the Container and assigns it a name.

System_CAPS_protmethodCreateSite(IComponent, String)

Creates a site ISite for the given IComponent and assigns the given name to the site.

System_CAPS_pubmethodDispose()

Releases all resources used by the Container.

System_CAPS_protmethodDispose(Boolean)

Releases the unmanaged resources used by the Container, and optionally releases the managed resources.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Releases unmanaged resources and performs other cleanup operations before the Container is reclaimed by garbage collection.(Overrides Object.Finalize().)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_protmethodGetService(Type)

Gets the service object of the specified type, if it is available.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodRemove(IComponent)

Removes a component from the Container.

System_CAPS_protmethodRemoveWithoutUnsiting(IComponent)

Removes a component from the Container without setting Site to null.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_protmethodValidateName(IComponent, String)

Determines whether the component name is unique for this container.

The Container class is the default implementation for the IContainer interface.

Containers are objects that encapsulate and track zero or more components. In this context, containment refers to logical containment, not visual containment. You can use components and containers in a variety of scenarios, including scenarios that are both visual and not visual.

The components in a container are tracked in a first-in, first-out list, which also defines the order of the components within the container. Added components are appended to the end of the list.

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft