Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Security.​SecurityElement

Assembly: System.Runtime

Inheritance: object → SecurityElement

Represents the XML object model for encoding security objects. This class cannot be inherited.

Properties

Attributes
Gets or sets the attributes of an XML element as name/value pairs.
Children
Gets or sets the array of child elements of the XML element.
public string
Tag
Gets or sets the tag name of an XML element.
public string
Text
Gets or sets the text within an XML element.

Methods

public void
AddAttribute​(string name, string value)
name The name of the attribute.
value The value of the attribute.
Adds a name/value attribute to an XML element.
public void
AddChild​(SecurityElement child)
child The child element to add.
Adds a child element to the XML element.
public string
Attribute​(string name)
name The name of the attribute for which to search.
Returns The value associated with the named attribute, or <see langword="null" /> if no attribute with <paramref name="name" /> exists.
Finds an attribute by name in an XML element.
Copy​()
Returns A copy of the current <see cref="T:System.Security.SecurityElement" /> object.
Creates and returns an identical copy of the current <see cref="T:System.Security.SecurityElement" /> object.
public bool
Equal​(SecurityElement other)
other An XML element object to which to compare the current XML element object.
Returns <see langword="true" /> if the tag, attribute names and values, child elements, and text fields in the current XML element are identical to their counterparts in the <paramref name="other" /> parameter; otherwise, <see langword="false" /> .
Compares two XML element objects for equality.
SearchForChildByTag​(string tag)
tag The tag for which to search in child elements.
Returns The first child XML element with the specified tag value, or <see langword="null" /> if no child element with <paramref name="tag" /> exists.
Finds a child by its tag name.
public string
SearchForTextOfTag​(string tag)
tag The tag for which to search in child elements.
Returns The text contents of the first child element with the specified tag value.
Finds a child by its tag name and returns the contained text.
public string
ToString​()
Returns The XML element and its contents.
Produces a string representation of an XML element and its constituent attributes, child elements, and text.
public bool
Equals​(object obj)
Inherited from object
obj The object to compare with the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
Determines whether the specified object is equal to the current object.
protected void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public int
GetHashCode​()
Inherited from object
Returns A hash code for the current object.
Serves as the default hash function.
public Type
GetType​()
Inherited from object
Returns The exact runtime type of the current instance.
Gets the <see cref="T:System.Type" /> of the current instance.
protected object
MemberwiseClone​()
Inherited from object
Returns A shallow copy of the current <see cref="T:System.Object" /> .
Creates a shallow copy of the current <see cref="T:System.Object" /> .