C# Class SharpNeat.Domains.XmlUtils

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

Méthodes publiques

Méthode 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 méthode

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
Résultat bool

GetValueAsDouble() public static méthode

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
Résultat double

GetValueAsInt() public static méthode

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
Résultat int

GetValueAsString() public static méthode

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
Résultat string

TryGetValueAsBool() public static méthode

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
Résultat bool?

TryGetValueAsDouble() public static méthode

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
Résultat double?

TryGetValueAsInt() public static méthode

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
Résultat int?

TryGetValueAsString() public static méthode

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
Résultat string