Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Container::ValidateName Method (IComponent^, String^)

 

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:
© 2017 Microsoft