SecurityElement Constructors

Definition

Initializes a new instance of the SecurityElement class.

Overloads

SecurityElement(String)

Initializes a new instance of the SecurityElement class with the specified tag.

SecurityElement(String, String)

Initializes a new instance of the SecurityElement class with the specified tag and text.

SecurityElement(String)

Source:
SecurityElement.cs
Source:
SecurityElement.cs
Source:
SecurityElement.cs

Initializes a new instance of the SecurityElement class with the specified tag.

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

Parameters

tag
String

The tag name of an XML element.

Exceptions

The tag parameter is null.

The tag parameter is invalid in XML.

Examples

The following code shows the use of the SecurityElement constructor to create a new SecurityElement object. This code example is part of a larger example provided for the SecurityElement class.

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

Remarks

The tag parameter must consist of a valid XML tag name. Use Escape to remove invalid characters from the string.

Applies to

SecurityElement(String, String)

Source:
SecurityElement.cs
Source:
SecurityElement.cs
Source:
SecurityElement.cs

Initializes a new instance of the SecurityElement class with the specified tag and text.

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)

Parameters

tag
String

The tag name of the XML element.

text
String

The text content within the element.

Exceptions

The tag parameter is null.

The tag parameter or text parameter is invalid in XML.

Remarks

If the text parameter is null this constructor produces an element identical to the parameterless constructor.

Applies to