C# Class Microsoft.Silverlight.Testing.Service.SimpleXElement

A simple implementation similar to XElement.
Mostrar archivo Open project: garyjohnson/wpnest Class Usage Examples

Public Methods

Method Description
Add ( SimpleXElement child ) : void

Adds a child element to the simple element instance.

Attribute ( string name ) : string

Gets an attribute value.

Descendants ( string elementName ) : IEnumerable

Returns descendants.

Parse ( string xml ) : SimpleXElement

Creates a new SimpleXElement.

SetAttributeValue ( string attribute, string value ) : void

Sets the value of an attribute.

SetElementValue ( string elementName, string value ) : void

Sets the value of a new child element.

SetElementValue ( string elementName, string value, string xmlNamespace ) : void

Sets the value of a new child element with an XML namespace value.

SetValue ( string value ) : void

Sets the value of the element.

SimpleXElement ( string elementName ) : System

Initializes a new instance of the element.

SimpleXElement ( string elementName, string ns ) : System

Initializes a new instance of the element.

ToString ( ) : string

Generates the string representation of the element and its tree.

Private Methods

Method Description
ParseInternal ( XmlReader reader, bool isFirst ) : void

Parses the current level with the XmlReader instance.

SimpleXElement ( ) : System

Initializes a new instance of the class.

SimpleXElement ( XmlReader newElementReader ) : System

Initializes a new instance of the class using the reader as the current root of the element.

WriteElement ( XmlWriter w ) : void

Writes to the XML writer without document start and ends.

Method Details

Add() public method

Adds a child element to the simple element instance.
public Add ( SimpleXElement child ) : void
child SimpleXElement The child element instance.
return void

Attribute() public method

Gets an attribute value.
public Attribute ( string name ) : string
name string The attribute name.
return string

Descendants() public method

Returns descendants.
public Descendants ( string elementName ) : IEnumerable
elementName string The element name to look for.
return IEnumerable

Parse() public static method

Creates a new SimpleXElement.
public static Parse ( string xml ) : SimpleXElement
xml string XML content.
return SimpleXElement

SetAttributeValue() public method

Sets the value of an attribute.
public SetAttributeValue ( string attribute, string value ) : void
attribute string The attribute name.
value string The attribute value.
return void

SetElementValue() public method

Sets the value of a new child element.
public SetElementValue ( string elementName, string value ) : void
elementName string The element name.
value string The value of the new element.
return void

SetElementValue() public method

Sets the value of a new child element with an XML namespace value.
public SetElementValue ( string elementName, string value, string xmlNamespace ) : void
elementName string The element name.
value string The value of the new element.
xmlNamespace string The XML namespace.
return void

SetValue() public method

Sets the value of the element.
public SetValue ( string value ) : void
value string The new string value.
return void

SimpleXElement() public method

Initializes a new instance of the element.
public SimpleXElement ( string elementName ) : System
elementName string The name of the element.
return System

SimpleXElement() public method

Initializes a new instance of the element.
public SimpleXElement ( string elementName, string ns ) : System
elementName string The name of the element.
ns string The XML namespace of the element.
return System

ToString() public method

Generates the string representation of the element and its tree.
public ToString ( ) : string
return string