Table of Contents

Class XmlDataReader

Namespace
Cuemon.Data.Xml
Assembly
Cuemon.Data.dll

Provides a way of reading a forward-only stream of rows from an XML based data source. This class cannot be inherited.

public sealed class XmlDataReader : DataReader<bool>, IDataReader, IDataRecord, IDisposable
Inheritance
Object
DataReader<Boolean>
XmlDataReader
Implements
IDataReader
IDataRecord
IDisposable
Inherited Members

Constructors

XmlDataReader(XmlReader, Func<String, Object>, Action<FormattingOptions>)

Initializes a new instance of the XmlDataReader class.

public XmlDataReader(XmlReader reader, Func<string, object> parser = null, Action<FormattingOptions> setup = null)

Parameters

reader XmlReader

The System.Xml.XmlReader object that contains the XML data.

parser Func<String, Object>

The function delegate that returns a primitive object whose value is equivalent to the provided System.String value. Default is FromValueType().

setup Action<FormattingOptions>

The FormattingOptions which may be configured.

Exceptions

System.ArgumentNullException

reader is null.

Properties

Depth

Gets a value indicating the depth of nesting for the current element.

public override int Depth { get; }

Property Value

Int32

The level of nesting.

NullRead

Gets the value that indicates that no more rows exists.

protected override bool NullRead { get; }

Property Value

Boolean

The value that indicates that no more rows exists.

RowCount

Gets the currently processed row count of this instance.

public override int RowCount { get; protected set; }

Property Value

Int32

The currently processed row count of this instance.

Remarks

This property is incremented when the invoked Read() method returns true.

Methods

OnDisposeManagedResources()

Called when this object is being disposed by either Dispose() or Dispose(Boolean) having disposing set to true and Disposed is false.

protected override void OnDisposeManagedResources()

Read()

Advances this instance to the next element of the XML data source.

public override bool Read()

Returns

Boolean

true if there are more elements; otherwise, false.

Exceptions

System.ObjectDisposedException

This instance has been disposed.

ReadNext(Boolean)

Advances this instance to the next element of the XML data source.

protected override bool ReadNext(bool columns)

Parameters

columns Boolean

Returns

Boolean

true if there are more elements; otherwise, false.

Exceptions

System.ObjectDisposedException

This instance has been disposed.