SecurityElement Konstruktory

Definice

Inicializuje novou instanci SecurityElement třídy.

Přetížení

SecurityElement(String)

Inicializuje novou instanci SecurityElement třídy se zadanou značkou.

SecurityElement(String, String)

Inicializuje novou instanci SecurityElement třídy se zadanou značkou a textem.

SecurityElement(String)

Inicializuje novou instanci SecurityElement třídy se zadanou značkou.

public:
 SecurityElement(System::String ^ tag);
public SecurityElement (string tag);
new System.Security.SecurityElement : string -> System.Security.SecurityElement
Public Sub New (tag As String)

Parametry

tag
String

Název značky elementu XML.

Výjimky

tagParametr je null .

tagParametr není v kódu XML platný.

Příklady

Následující kód ukazuje použití SecurityElement konstruktoru pro vytvoření nového SecurityElement objektu. Tento příklad kódu je součástí většího příkladu, který je k dispozici pro SecurityElement třídu.

SecurityElement^ windowsRoleElement = gcnew SecurityElement( L"WindowsMembership.WindowsRole" );
SecurityElement windowsRoleElement =
    new SecurityElement("WindowsMembership.WindowsRole");
Dim windowsRoleElement As New SecurityElement("WindowsMembership.WindowsRole")

Poznámky

tagParametr musí obsahovat platný název značky XML. Slouží Escape k odebrání neplatných znaků z řetězce.

Platí pro

SecurityElement(String, String)

Inicializuje novou instanci SecurityElement třídy se zadanou značkou a textem.

public:
 SecurityElement(System::String ^ tag, System::String ^ text);
public SecurityElement (string tag, string? text);
public SecurityElement (string tag, string text);
new System.Security.SecurityElement : string * string -> System.Security.SecurityElement
Public Sub New (tag As String, text As String)

Parametry

tag
String

Název značky elementu XML.

text
String

Textový obsah v rámci elementu.

Výjimky

tagParametr je null .

tagParametr nebo text parametr jsou v kódu XML neplatné.

Poznámky

Pokud text je parametr null tohoto konstruktoru, vytvoří prvek totožný s konstruktor bez parametrů.

Platí pro