ConfigurationElement Konstruktor

Definice

Inicializuje novou instanci ConfigurationElement třídy.

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

Příklady

Následující příklad ukazuje, jak použít vlastní konstruktor.

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

Poznámky

Vytvoříte novou instanci ConfigurationElement třídy, například pokaždé, když vaše aplikace potřebuje přidat nový prvek do související ConfigurationElementCollection kolekce.

Platí pro