ConfigurationElement Konstruktor

Definicja

Inicjuje nowe wystąpienie klasy ConfigurationElement.

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

Przykłady

W poniższym przykładzie pokazano, jak używać niestandardowego konstruktora.

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

Uwagi

Tworzysz nowe wystąpienie ConfigurationElement klasy, na przykład za każdym razem, gdy aplikacja musi dodać nowy element do powiązanej ConfigurationElementCollection kolekcji.

Dotyczy