Class XmlDataReader
Provides methods for reading data in the Xml format.
Implements
Inherited Members
Namespace: Terrasoft.Common
Assembly: Terrasoft.Common.dll
Syntax
public class XmlDataReader : DataReader, IDataReader, IDisposable
Constructors
XmlDataReader(Stream)
Initializes a new instance of the XmlDataReader class using the specified stream.
Declaration
public XmlDataReader(Stream input)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | input | The stream that contains data in Xml format. |
Remarks
Method looks for the byte sequence marker or any other encoding attribute in first bytes of a stream. After it has been identified, the encoding is used in the next reading of stream, and the processing procedire continues analyzing incoming data as a Unicode stream.
XmlDataReader(TextReader)
Initializes a new instance of the XmlDataReader class using the specified System.IO.TextReader.
Declaration
public XmlDataReader(TextReader input)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextReader | input | System.IO.TextReader, from which the data in Xml format should be read. The data are returned in the Unicode format. The encoding specified in XML declaration is not used XmlDataReader for decoding data stream. |
Properties
CurrentName
Returns the name of the current attribute.
Declaration
public override string CurrentName { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
CurrentValue
Returns the value of the current attribute.
Declaration
public override object CurrentValue { get; }
Property Value
Type | Description |
---|---|
System.Object |
Overrides
Methods
Close()
Closes the current XmlDataReader instance.
Declaration
public override void Close()
Overrides
Dispose(Boolean)
Deletes, releases and resets managed and unmanaged resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
|
Overrides
GetBoolValue()
Returns the value of the current attribute of the System.Boolean type.
Declaration
public override bool GetBoolValue()
Returns
Type | Description |
---|---|
System.Boolean | The value of the current attribute of the System.Boolean type. |
Overrides
GetDateTimeValue()
Returns the value of the current attribute of the System.DateTime type.
Declaration
public override DateTime GetDateTimeValue()
Returns
Type | Description |
---|---|
System.DateTime | The value of the current attribute of the System.DateTime type. |
Overrides
GetDeserializedObjectValue(Type)
Declaration
public override object GetDeserializedObjectValue(Type objectType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | objectType |
Returns
Type | Description |
---|---|
System.Object |
Overrides
GetDoubleValue()
Returns the value of the current attribute of the System.Double type.
Declaration
public override double GetDoubleValue()
Returns
Type | Description |
---|---|
System.Double | The value of the current attribute of the System.Double type. |
Overrides
GetEnumValue<TValue>()
Gets the enumeration element that corresponds to the value of the current attribute.
Declaration
public override TValue GetEnumValue<TValue>()
where TValue : struct
Returns
Type | Description |
---|---|
TValue | Enumeration member that corresponds to the current attribute value |
Type Parameters
Name | Description |
---|---|
TValue | The value of enumeration of any type. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If the |
GetGuidValue()
Returns the value of the current attribute of the System.Guid type.
Declaration
public override Guid GetGuidValue()
Returns
Type | Description |
---|---|
System.Guid | The value of the current attribute of the System.Guid type. |
Overrides
GetIntValue()
Returns the value of the current attribute of the System.Int32 type.
Declaration
public override int GetIntValue()
Returns
Type | Description |
---|---|
System.Int32 | The value of the current attribute of the System.Int32 type. |
Overrides
GetLocalizableStringValue()
Returns the value of the current attribute of the LocalizableString type.
Declaration
public override LocalizableString GetLocalizableStringValue()
Returns
Type | Description |
---|---|
LocalizableString | The value of the current attribute of the LocalizableString type. |
Overrides
GetSerialazebleObjectValue(Type)
Declaration
public override object GetSerialazebleObjectValue(Type objectType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | objectType |
Returns
Type | Description |
---|---|
System.Object |
Overrides
GetSerializableObjectValue()
Declaration
public override object GetSerializableObjectValue()
Returns
Type | Description |
---|---|
System.Object |
Overrides
GetSerializableObjectValue<TValue>()
Declaration
public override TValue GetSerializableObjectValue<TValue>()
Returns
Type | Description |
---|---|
TValue |
Type Parameters
Name | Description |
---|---|
TValue |
Overrides
GetStreamValue()
Returns the value of the current attribute of the System.IO.Stream type.
Declaration
public override Stream GetStreamValue()
Returns
Type | Description |
---|---|
System.IO.Stream | The value of the current attribute of the System.IO.Stream type. |
Overrides
GetStreamValue(Stream)
Writes the value of the current property to the specified stream.
Declaration
public override void GetStreamValue(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream to write to. |
Overrides
GetStringValue()
Gets the string presentation of the attribute value that are located at the current dataset position.
Declaration
public override string GetStringValue()
Returns
Type | Description |
---|---|
System.String | The current value of the attribute of the System.String. |
Overrides
GetValue(Type)
Gets the value of the current attribute converted to the specified type.
Declaration
public override object GetValue(Type valueType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | valueType | Type. |
Returns
Type | Description |
---|---|
System.Object | The value of the current attribute, converted to the |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
UnsupportedTypeException | If the |
GetValue(DataConverter)
Gets object that represents the value of the current attribute, converted with the help of the passed instance DataConverter.
Declaration
public override object GetValue(DataConverter converter)
Parameters
Type | Name | Description |
---|---|---|
DataConverter | converter | The DataConverter instance, used for conversion. |
Returns
Type | Description |
---|---|
System.Object | The value of the current attribute of the System.Object type converted to |
Overrides
GetValue<TValue>()
Gets the value of this type of the current attribute, converting it to this type.
Declaration
public override TValue GetValue<TValue>()
Returns
Type | Description |
---|---|
TValue | The converted attribute value. |
Type Parameters
Name | Description |
---|---|
TValue | The value of any type. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If the |
UnsupportedTypeException | If the |
Read()
Moves the current position in the data set to the next attribute of the current nesting level.
Declaration
public override string Read()
Returns
Type | Description |
---|---|
System.String | The string with the current attribute name or empty string if the end of the data set has been reached. |
Overrides
ReadInto()
Moves the current position in the data set to one nesting level down.
Declaration
public override string ReadInto()
Returns
Type | Description |
---|---|
System.String | The string with the current attribute name or empty string if the current level has no attached attributes. |
Overrides
ReadNextCollectionItem()
The method is not implemented.
Declaration
public override bool ReadNextCollectionItem()
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
ReadOut()
Moves the current position in the data set to one nesting level up.
Declaration
public override string ReadOut()
Returns
Type | Description |
---|---|
System.String | The empty string. Call Read() to receive the name of the next attribute. |