Container.ValidateName(IComponent, String) Metódus

Definíció

Meghatározza, hogy az összetevő neve egyedi-e ehhez a tárolóhoz.

protected:
 virtual void ValidateName(System::ComponentModel::IComponent ^ component, System::String ^ name);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of components in the container cannot be statically discovered.")]
protected virtual void ValidateName(System.ComponentModel.IComponent component, string? name);
protected virtual void ValidateName(System.ComponentModel.IComponent component, string name);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of components in the container cannot be statically discovered.")>]
abstract member ValidateName : System.ComponentModel.IComponent * string -> unit
override this.ValidateName : System.ComponentModel.IComponent * string -> unit
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)

Paraméterek

component
IComponent

A névvel ellátott összetevő.

name
String

Az érvényesítendő összetevő neve.

Attribútumok

Kivételek

component az null.

name nem egyedi.

Megjegyzések

A ValidateName metódus meghívja a Add metódust annak megállapítására, hogy a hozzáadott név component egyedi-e.Container Ha a name paraméter nem null egyedi és nem egyedi, akkor a paramétert ArgumentException a függvény eldobja.

A következőre érvényes:

Lásd még