Container.ValidateName Method (IComponent, String)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Determines whether the component name is unique for this container.

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

protected virtual void ValidateName(
	IComponent component,
	string name
)

Parameters

component
Type: System.ComponentModel.IComponent

The named component.

name
Type: System.String

The component name to validate.

Exception Condition
ArgumentNullException

component is null.

ArgumentException

name is not unique.

The ValidateName method is called by the Add method to determine if the name of the component being added is unique for this Container. If the name parameter is not null and is not unique, an ArgumentException is thrown.

.NET Framework
Available since 2.0
Return to top
Show: