NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Container.Add (IComponent, String)

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

[Visual Basic]
Overloads Overridable Public Sub Add( _
   ByVal component As IComponent, _
   ByVal name As String _
)
[C#]
public virtual void Add(
   IComponent component,
   string name
);
[C++]
public: virtual void Add(
   IComponent* component,
   String* name
);
[JScript]
public function Add(
   component : IComponent,
   name : String
);

Parameters

component
The component to add.
name
The unique name to assign to the component.

-or-

a null reference (in Visual Basic Nothing) to leave the component unnamed.

Return Value

None.

Exceptions

Exception Type Condition
InvalidOperationException name is already used by another component in the Container.

Remarks

This method can be overridden by a derived class.

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. The new component is added to the end of the list.Components may or may not have a name. If a component is given a name, the name must be unique among the names of the components within the Container.

See Also

Container Class | Container Members | System.ComponentModel Namespace | Container.Add Overload List | Remove