Uređivanje

Dijeli putem


Container.ValidateName(IComponent, String) Method

Definition

Determines whether the component name is unique for this container.

protected:
 virtual void ValidateName(System::ComponentModel::IComponent ^ component, System::String ^ name);
protected virtual void ValidateName (System.ComponentModel.IComponent component, string name);
protected virtual void ValidateName (System.ComponentModel.IComponent component, string? name);
abstract member ValidateName : System.ComponentModel.IComponent * string -> unit
override this.ValidateName : System.ComponentModel.IComponent * string -> unit
Protected Overridable Sub ValidateName (component As IComponent, name As String)

Parameters

component
IComponent

The named component.

name
String

The component name to validate.

Exceptions

component is null.

name is not unique.

Remarks

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.

Applies to

See also