Show / Hide Table of Contents

Class XmlReaderExtensions

Extensions for System.Xml.XmlReader to help deserializing graph data.

Inheritance
System.Object
XmlReaderExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: QuikGraph.Serialization
Assembly: QuikGraph.Serialization.dll
Syntax
public static class XmlReaderExtensions

Methods

| Improve this Doc View Source

ReadElementAsNullableString(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

localName is null.

System.ArgumentNullException

namespaceURI is null.

System.ArgumentException

localName is empty.

| Improve this Doc View Source

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 T.

Returns
Type Description
T[]

Array of T.

Type Parameters
Name Description
T

Array element type.

Exceptions
Type Condition
System.ArgumentNullException

localName is null.

System.ArgumentNullException

namespaceURI is null.

System.ArgumentException

localName is empty.

| Improve this Doc View Source

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

localName is null.

System.ArgumentNullException

namespaceURI is null.

System.ArgumentException

localName is empty.

| Improve this Doc View Source

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

localName is null.

System.ArgumentNullException

namespaceURI is null.

System.ArgumentException

localName is empty.

| Improve this Doc View Source

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

localName is null.

System.ArgumentNullException

namespaceURI is null.

System.ArgumentException

localName is empty.

| Improve this Doc View Source

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

localName is null.

System.ArgumentNullException

namespaceURI is null.

System.ArgumentException

localName is empty.

| Improve this Doc View Source

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

localName is null.

System.ArgumentNullException

namespaceURI is null.

System.ArgumentException

localName is empty.

| Improve this Doc View Source

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

localName is null.

System.ArgumentNullException

namespaceURI is null.

System.ArgumentException

localName is empty.

  • Improve this Doc
  • View Source
In This Article
Back to top QuikGraph