Export (0) Print
Expand All

INestedContainer Interface

Provides functionality for nested containers, which logically contain zero or more other components and are owned by a parent component.

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

public interface INestedContainer : IContainer, 
	IDisposable

The INestedContainer type exposes the following members.

  NameDescription
Public propertyComponentsGets all the components in the IContainer. (Inherited from IContainer.)
Public propertyOwnerGets the owning component for the nested container.
Top

  NameDescription
Public methodAdd(IComponent)Adds the specified IComponent to the IContainer at the end of the list. (Inherited from IContainer.)
Public methodAdd(IComponent, String)Adds the specified IComponent to the IContainer at the end of the list, and assigns a name to the component. (Inherited from IContainer.)
Public methodDisposePerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from IDisposable.)
Public methodRemoveRemoves a component from the IContainer. (Inherited from IContainer.)
Top

The INestedContainer interface adds the concept of an owning component to the IContainer interface. A nested container is an object that logically, but not necessarily visually, contains zero or more child components and is owned by some parent component. For visual containment, the owning component is often another container.

Nested containers allow sections of a control to be designable, without requiring an explicit serialized member variable or a custom serializer for each subcontrol. Instead, the form designer maintains one master container of components. Each component’s site may have a nested container that provides a place to put extra components. When a component is sited in a nested container, the name it receives is a combination of its given name and its owning component’s name. Additionally, components added to a nested container have full access to the services of the parent container, and the nested container provides the same behavior of the parent with respect to adding new components. The nested container will create the designer for each component it contains, thereby enabling design-time support. Because standard code serializers do not look at nested containers, these components are only serialized if a path to them can be obtained by walking the components in the primary container.

Nested containers can be found by querying a component's site for services of type INestedContainer.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft