C# Class TVSorter.Storage.XElementExtensions

Provides extensions methods for the XElement class.
Mostrar archivo Open project: a-jackson/tvsorter

Public Methods

Method Description
GetAttribute ( this element, string name, string defaultValue = null ) : string

Gets the value of the specified attribute from the specified element.

GetElementText ( this element, System.Xml.Linq.XName name, string defaultValue = null ) : string

Gets the text from child element of the specified element. Returns defaultValue if it doesn't exist.

GetElementsText ( this element, System.Xml.Linq.XName name ) : IEnumerable

Gets the text from child element of the specified element. Returns defaultValue if it doesn't exist.

Method Details

GetAttribute() public static method

Gets the value of the specified attribute from the specified element.
public static GetAttribute ( this element, string name, string defaultValue = null ) : string
element this /// The element to read the attribute from. ///
name string /// The name of the attribute. ///
defaultValue string /// The value to return if the attribute doesn't exist. ///
return string

GetElementText() public static method

Gets the text from child element of the specified element. Returns defaultValue if it doesn't exist.
public static GetElementText ( this element, System.Xml.Linq.XName name, string defaultValue = null ) : string
element this /// The element to read. ///
name System.Xml.Linq.XName /// The name of the child element. ///
defaultValue string /// The default value to return if it doesn't exist. ///
return string

GetElementsText() public static method

Gets the text from child element of the specified element. Returns defaultValue if it doesn't exist.
public static GetElementsText ( this element, System.Xml.Linq.XName name ) : IEnumerable
element this /// The element to read. ///
name System.Xml.Linq.XName /// The name of the child element. ///
return IEnumerable