Represents the XML object model for encoding security objects. This class cannot be inherited.
More...
Inherits System.Security.ISecurityElementFactory.
|
string | Tag [get, set] |
| Gets or sets the tag name of an XML element. More...
|
|
Hashtable | Attributes [get, set] |
| Gets or sets the attributes of an XML element as name/value pairs. More...
|
|
string | Text [get, set] |
| Gets or sets the text within an XML element. More...
|
|
ArrayList | Children [get, set] |
| Gets or sets the array of child elements of the XML element. More...
|
|
Represents the XML object model for encoding security objects. This class cannot be inherited.
Definition at line 14 of file SecurityElement.cs.
◆ SecurityElement() [1/2]
System.Security.SecurityElement.SecurityElement |
( |
string |
tag | ) |
|
Initializes a new instance of the T:System.Security.SecurityElement class with the specified tag.
- Parameters
-
tag | The tag name of an XML element. |
- Exceptions
-
T:System.ArgumentNullException | The tag parameter is null . |
T:System.ArgumentException | The tag parameter is invalid in XML. |
Definition at line 246 of file SecurityElement.cs.
◆ SecurityElement() [2/2]
System.Security.SecurityElement.SecurityElement |
( |
string |
tag, |
|
|
string |
text |
|
) |
| |
Initializes a new instance of the T:System.Security.SecurityElement class with the specified tag and text.
- Parameters
-
tag | The tag name of the XML element. |
text | The text content within the element. |
- Exceptions
-
T:System.ArgumentNullException | The tag parameter is null . |
T:System.ArgumentException | The tag parameter or text parameter is invalid in XML. |
Definition at line 265 of file SecurityElement.cs.
◆ AddAttribute()
void System.Security.SecurityElement.AddAttribute |
( |
string |
name, |
|
|
string |
value |
|
) |
| |
Adds a name/value attribute to an XML element.
- Parameters
-
name | The name of the attribute. |
value | The value of the attribute. |
- Exceptions
-
T:System.ArgumentNullException | The name parameter or value parameter is null . |
T:System.ArgumentException | The name parameter or value parameter is invalid in XML.-or- An attribute with the name specified by the name parameter already exists. |
Definition at line 326 of file SecurityElement.cs.
◆ AddChild()
Adds a child element to the XML element.
- Parameters
-
child | The child element to add. |
- Exceptions
-
T:System.ArgumentNullException | The child parameter is null . |
Definition at line 350 of file SecurityElement.cs.
◆ Attribute()
string System.Security.SecurityElement.Attribute |
( |
string |
name | ) |
|
Finds an attribute by name in an XML element.
- Parameters
-
name | The name of the attribute for which to search. |
- Returns
- The value associated with the named attribute, or
null
if no attribute with name exists.
- Exceptions
-
T:System.ArgumentNullException | The name parameter is null . |
Definition at line 730 of file SecurityElement.cs.
◆ Copy()
Creates and returns an identical copy of the current T:System.Security.SecurityElement object.
- Returns
- A copy of the current T:System.Security.SecurityElement object.
Definition at line 474 of file SecurityElement.cs.
◆ Equal()
Compares two XML element objects for equality.
- Parameters
-
other | An XML element object to which to compare the current XML element object. |
- Returns
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 other parameter; otherwise, false
.
Definition at line 402 of file SecurityElement.cs.
◆ Escape()
static string System.Security.SecurityElement.Escape |
( |
string |
str | ) |
|
|
static |
Replaces invalid XML characters in a string with their valid XML equivalent.
- Parameters
-
str | The string within which to escape invalid characters. |
- Returns
- The input string with invalid characters replaced.
Definition at line 548 of file SecurityElement.cs.
◆ FromString()
static SecurityElement System.Security.SecurityElement.FromString |
( |
string |
xml | ) |
|
|
static |
Creates a security element from an XML-encoded string.
- Parameters
-
xml | The XML-encoded string from which to create the security element. |
- Returns
- A T:System.Security.SecurityElement created from the XML.
- Exceptions
-
T:System.Security.XmlSyntaxException | xml contains one or more single quotation mark characters. |
T:System.ArgumentNullException | xml is null . |
Definition at line 233 of file SecurityElement.cs.
◆ IsValidAttributeName()
static bool System.Security.SecurityElement.IsValidAttributeName |
( |
string |
name | ) |
|
|
static |
Determines whether a string is a valid attribute name.
- Parameters
-
name | The attribute name to test for validity. |
- Returns
true
if the name parameter is a valid XML attribute name; otherwise, false
.
Definition at line 512 of file SecurityElement.cs.
◆ IsValidAttributeValue()
static bool System.Security.SecurityElement.IsValidAttributeValue |
( |
string |
value | ) |
|
|
static |
Determines whether a string is a valid attribute value.
- Parameters
-
value | The attribute value to test for validity. |
- Returns
true
if the value parameter is a valid XML attribute value; otherwise, false
.
Definition at line 521 of file SecurityElement.cs.
◆ IsValidTag()
static bool System.Security.SecurityElement.IsValidTag |
( |
string |
tag | ) |
|
|
static |
Determines whether a string is a valid tag.
- Parameters
-
tag | The tag to test for validity. |
- Returns
true
if the tag parameter is a valid XML tag; otherwise, false
.
Definition at line 486 of file SecurityElement.cs.
◆ IsValidText()
static bool System.Security.SecurityElement.IsValidText |
( |
string |
text | ) |
|
|
static |
Determines whether a string is valid as text within an XML element.
- Parameters
-
text | The text to test for validity. |
- Returns
true
if the text parameter is a valid XML text element; otherwise, false
.
Definition at line 499 of file SecurityElement.cs.
◆ SearchForChildByTag()
SecurityElement System.Security.SecurityElement.SearchForChildByTag |
( |
string |
tag | ) |
|
Finds a child by its tag name.
- Parameters
-
tag | The tag for which to search in child elements. |
- Returns
- The first child XML element with the specified tag value, or
null
if no child element with tag exists.
- Exceptions
-
T:System.ArgumentNullException | The tag parameter is null . |
Definition at line 757 of file SecurityElement.cs.
◆ SearchForTextOfTag()
string System.Security.SecurityElement.SearchForTextOfTag |
( |
string |
tag | ) |
|
Finds a child by its tag name and returns the contained text.
- Parameters
-
tag | The tag for which to search in child elements. |
- Returns
- The text contents of the first child element with the specified tag value.
- Exceptions
-
T:System.ArgumentNullException | tag is null . |
Definition at line 839 of file SecurityElement.cs.
◆ ToString()
override string System.Security.SecurityElement.ToString |
( |
| ) |
|
Produces a string representation of an XML element and its constituent attributes, child elements, and text.
- Returns
- The XML element and its contents.
Definition at line 642 of file SecurityElement.cs.
◆ Attributes
Hashtable System.Security.SecurityElement.Attributes |
|
getset |
Gets or sets the attributes of an XML element as name/value pairs.
- Returns
- The T:System.Collections.Hashtable object for the attribute values of the XML element.
- Exceptions
-
T:System.InvalidCastException | The name or value of the T:System.Collections.Hashtable object is invalid. |
T:System.ArgumentException | The name is not a valid XML attribute name. |
Definition at line 106 of file SecurityElement.cs.
◆ Children
ArrayList System.Security.SecurityElement.Children |
|
getset |
Gets or sets the array of child elements of the XML element.
- Returns
- The ordered child elements of the XML element as security elements.
- Exceptions
-
T:System.ArgumentException | A child of the XML parent node is null . |
Definition at line 177 of file SecurityElement.cs.
◆ Tag
string System.Security.SecurityElement.Tag |
|
getset |
Gets or sets the tag name of an XML element.
- Returns
- The tag name of an XML element.
- Exceptions
-
T:System.ArgumentNullException | The tag is null . |
T:System.ArgumentException | The tag is not valid in XML. |
Definition at line 82 of file SecurityElement.cs.
◆ Text
string System.Security.SecurityElement.Text |
|
getset |
Gets or sets the text within an XML element.
- Returns
- The value of the text within an XML element.
- Exceptions
-
T:System.ArgumentException | The text is not valid in XML. |
Definition at line 153 of file SecurityElement.cs.
The documentation for this class was generated from the following file: