Class XmlReaderExtensions
Extensions for System.Xml.XmlReader to help deserializing graph data.
Inheritance
Inherited Members
Namespace: QuikGraph.Serialization
Assembly: QuikGraph.Serialization.dll
Syntax
public static class XmlReaderExtensions
Methods
| Improve this Doc View SourceReadElementAsNullableString(XmlReader, String, String)
Reads a named element as a string.
Declaration
public static string ReadElementAsNullableString(XmlReader xmlReader, string localName, string namespaceURI)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | xmlReader | XML reader. |
System.String | localName | Node name. |
System.String | namespaceURI | XML namespace. |
Returns
Type | Description |
---|---|
System.String | Boolean array. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
System.ArgumentException |
|
ReadElementContentAsArray<T>(XmlReader, String, String, Func<String, T>)
Read contents of an XML element as an array of type T.
Declaration
public static T[] ReadElementContentAsArray<T>(XmlReader xmlReader, string localName, string namespaceURI, Func<string, T> stringToT)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | xmlReader | XML reader. |
System.String | localName | Node name. |
System.String | namespaceURI | XML namespace. |
System.Func<System.String, T> | stringToT | Converts the XML element string as |
Returns
Type | Description |
---|---|
T[] | Array of |
Type Parameters
Name | Description |
---|---|
T | Array element type. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
System.ArgumentException |
|
ReadElementContentAsBooleanArray(XmlReader, String, String)
Reads the content of a named element as an array of booleans.
Declaration
public static bool[] ReadElementContentAsBooleanArray(XmlReader xmlReader, string localName, string namespaceURI)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | xmlReader | XML reader. |
System.String | localName | Node name. |
System.String | namespaceURI | XML namespace. |
Returns
Type | Description |
---|---|
System.Boolean[] | Boolean array. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
System.ArgumentException |
|
ReadElementContentAsDoubleArray(XmlReader, String, String)
Reads the content of a named element as an array of doubles.
Declaration
public static double[] ReadElementContentAsDoubleArray(XmlReader xmlReader, string localName, string namespaceURI)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | xmlReader | XML reader. |
System.String | localName | Node name. |
System.String | namespaceURI | XML namespace. |
Returns
Type | Description |
---|---|
System.Double[] | Double array. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
System.ArgumentException |
|
ReadElementContentAsInt32Array(XmlReader, String, String)
Reads the content of a named element as an array of ints.
Declaration
public static int[] ReadElementContentAsInt32Array(XmlReader xmlReader, string localName, string namespaceURI)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | xmlReader | XML reader. |
System.String | localName | Node name. |
System.String | namespaceURI | XML namespace. |
Returns
Type | Description |
---|---|
System.Int32[] | Int array. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
System.ArgumentException |
|
ReadElementContentAsInt64Array(XmlReader, String, String)
Reads the content of a named element as an array of longs.
Declaration
public static long[] ReadElementContentAsInt64Array(XmlReader xmlReader, string localName, string namespaceURI)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | xmlReader | XML reader. |
System.String | localName | Node name. |
System.String | namespaceURI | XML namespace. |
Returns
Type | Description |
---|---|
System.Int64[] | Long array. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
System.ArgumentException |
|
ReadElementContentAsSingleArray(XmlReader, String, String)
Reads the content of a named element as an array of floats.
Declaration
public static float[] ReadElementContentAsSingleArray(XmlReader xmlReader, string localName, string namespaceURI)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | xmlReader | XML reader. |
System.String | localName | Node name. |
System.String | namespaceURI | XML namespace. |
Returns
Type | Description |
---|---|
System.Single[] | Float array. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
System.ArgumentException |
|
ReadElementContentAsStringArray(XmlReader, String, String)
Reads the content of a named element as an array of strings.
Declaration
public static string[] ReadElementContentAsStringArray(XmlReader xmlReader, string localName, string namespaceURI)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | xmlReader | XML reader. |
System.String | localName | Node name. |
System.String | namespaceURI | XML namespace. |
Returns
Type | Description |
---|---|
System.String[] | String array. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
System.ArgumentException |
|