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

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

Platí pro