ConfigurationElement Costruttore

Definizione

Inizializza una nuova istanza della classe ConfigurationElement.

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

Esempio

Nell'esempio seguente viene illustrato come usare un costruttore personalizzato.

// 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

Commenti

Si crea una nuova istanza della classe , ad esempio ogni volta che l'applicazione ConfigurationElement deve aggiungere un nuovo elemento alla raccolta correlata ConfigurationElementCollection .

Si applica a