C# Class SharpNeat.Domains.XmlUtils

Static helper methods for reading value from XML configuration data in DOM form.
Exibir arquivo Open project: colgreen/sharpneat

Public Methods

Method Description
GetValueAsBool ( XmlElement xmlParent, string elemName ) : bool

Parse the inner text of element with the given name as a boolean. If element is missing or parsing fails then throws an ArgumentException.

GetValueAsDouble ( XmlElement xmlParent, string elemName ) : double

Parse the inner text of element with the given name as a double. If element is missing or parsing fails then throws an ArgumentException.

GetValueAsInt ( XmlElement xmlParent, string elemName ) : int

Parse the inner text of element with the given name as an integer. If element is missing or parsing fails then throws an ArgumentException.

GetValueAsString ( XmlElement xmlParent, string elemName ) : string

Read the inner text of element with the given name. If element is missing then throws an ArgumentException.

TryGetValueAsBool ( XmlElement xmlParent, string elemName ) : bool?

Parse the inner text of element with the given name as a boolean. If element is missing or parsing fails then returns null.

TryGetValueAsDouble ( XmlElement xmlParent, string elemName ) : double?

Parse the inner text of element with the given name as a double. If element is missing or parsing fails then returns null.

TryGetValueAsInt ( XmlElement xmlParent, string elemName ) : int?

Parse the inner text of element with the given name as an integer. If element is missing or parsing fails then returns null.

TryGetValueAsString ( XmlElement xmlParent, string elemName ) : string

Read the inner text of element with the given name. If element is missing then returns null.

Method Details

GetValueAsBool() public static method

Parse the inner text of element with the given name as a boolean. If element is missing or parsing fails then throws an ArgumentException.
public static GetValueAsBool ( XmlElement xmlParent, string elemName ) : bool
xmlParent System.Xml.XmlElement
elemName string
return bool

GetValueAsDouble() public static method

Parse the inner text of element with the given name as a double. If element is missing or parsing fails then throws an ArgumentException.
public static GetValueAsDouble ( XmlElement xmlParent, string elemName ) : double
xmlParent System.Xml.XmlElement
elemName string
return double

GetValueAsInt() public static method

Parse the inner text of element with the given name as an integer. If element is missing or parsing fails then throws an ArgumentException.
public static GetValueAsInt ( XmlElement xmlParent, string elemName ) : int
xmlParent System.Xml.XmlElement
elemName string
return int

GetValueAsString() public static method

Read the inner text of element with the given name. If element is missing then throws an ArgumentException.
public static GetValueAsString ( XmlElement xmlParent, string elemName ) : string
xmlParent System.Xml.XmlElement
elemName string
return string

TryGetValueAsBool() public static method

Parse the inner text of element with the given name as a boolean. If element is missing or parsing fails then returns null.
public static TryGetValueAsBool ( XmlElement xmlParent, string elemName ) : bool?
xmlParent System.Xml.XmlElement
elemName string
return bool?

TryGetValueAsDouble() public static method

Parse the inner text of element with the given name as a double. If element is missing or parsing fails then returns null.
public static TryGetValueAsDouble ( XmlElement xmlParent, string elemName ) : double?
xmlParent System.Xml.XmlElement
elemName string
return double?

TryGetValueAsInt() public static method

Parse the inner text of element with the given name as an integer. If element is missing or parsing fails then returns null.
public static TryGetValueAsInt ( XmlElement xmlParent, string elemName ) : int?
xmlParent System.Xml.XmlElement
elemName string
return int?

TryGetValueAsString() public static method

Read the inner text of element with the given name. If element is missing then returns null.
public static TryGetValueAsString ( XmlElement xmlParent, string elemName ) : string
xmlParent System.Xml.XmlElement
elemName string
return string