Share via


ConfigurationElement Constructeur

Définition

Initialise une nouvelle instance de la classe ConfigurationElement.

protected:
 ConfigurationElement();
protected ConfigurationElement ();
Protected Sub New ()

Exemples

L’exemple suivant montre comment utiliser un constructeur personnalisé.

// Constructor allowing name, url, and port to be specified.
public UrlConfigElement(String newName,
    String newUrl, int newPort)
{
    Name = newName;
    Url = newUrl;
    Port = newPort;
}
' Constructor allowing name, url, and port to be specified.
Public Sub New(ByVal newName As String, _
    ByVal newUrl As String, _
    ByVal newPort As Integer)

    Name = newName
    Url = newUrl
    Port = newPort

End Sub

Remarques

Vous créez une nouvelle instance de la ConfigurationElement classe, par exemple, chaque fois que votre application doit ajouter un nouvel élément à la collection associéeConfigurationElementCollection.

S’applique à