public sealed class SecurityElement
Represents the XML object model for encoding security objects.
The simple XML object model for an element consists of the following parts:
An attribute name must be at least one character, and cannot be
- The tag is the element name.
- The attributes are zero or more name/value attribute pairs on the element.
- The children are zero or more elements nested within
null. If element-based value representation is used, elements with a text string that is
nullare represented in the
<tag/>form; otherwise, text is delimited by the
</tag>tokens. Both forms can be combined with attributes, which are shown if present.
The tags, attributes, and text are case-sensitive. The XML form contains quotation marks and escape sequences where necessary. String values that include characters invalid for use in XML result in a ArgumentException. These rules apply to all properties and methods.
[Note: This class is intended to be a lightweight implementation of a simple XML object model for use within the security system, and not for use as a general XML object model.
It is strongly suggested that properties of a security element are expressed as attributes, and property values are expressed as attribute values. Specifically, avoid nesting text within tags. For any
<tag>text</tag>representation a representation of type
<tag value="text"/>is usually available. Using attribute-based XML representations aids in readability.
For performance reasons, character validity is checked only when the element is encoded into XML form, and not on every set of a property or method call. Static methods allow explicit checking where needed.
public override string ToString();
Returns a String representation of the current instance.
A String representation of the current instance.
[Note: The XML in the String returned by this method represents the state of a permission object. To obtain the XML schema used to encode that object, see the class page for the particular permission object .
This method overrides System.Object.ToString.
System.Security.SecurityElement Class, System.Security Namespace