Class XmlDataWriter
Provides methods for sequential writing of data in the XML format.
Inherited Members
Namespace: Terrasoft.Common
Assembly: Terrasoft.Common.dll
Syntax
public class XmlDataWriter : DataWriter, IDataWriter, IDisposable
Constructors
XmlDataWriter(XmlDataWriterSettings, Stream)
Initializes a new instance of the XmlDataWriter class using the specified settings of the instance and output stream.
Declaration
public XmlDataWriter(XmlDataWriterSettings settings, Stream output)
Parameters
Type | Name | Description |
---|---|---|
XmlDataWriterSettings | settings | Settings for the XmlDataWriterSettings new instance. |
System.IO.Stream | output | The stream to write to. |
XmlDataWriter(XmlDataWriterSettings, TextWriter)
Initializes a new instance of the XmlDataWriter class using the specified settings of the instance and System.IO.TextWriter.
Declaration
public XmlDataWriter(XmlDataWriterSettings settings, TextWriter output)
Parameters
Type | Name | Description |
---|---|---|
XmlDataWriterSettings | settings | Settings for the XmlDataWriterSettings new instance. |
System.IO.TextWriter | output | The System.IO.TextWriter instance that writes. |
Properties
Settings
Gets settings for the current XmlDataWriter instance.
Declaration
public XmlDataWriterSettings Settings { get; }
Property Value
Type | Description |
---|---|
XmlDataWriterSettings |
Methods
Close()
Closes the current XmlDataWriter instance.
Declaration
public override void Close()
Overrides
Dispose(Boolean)
Deletes, releases and resets resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
|
Overrides
WriteFinishCollection()
Method is not implemented.
Declaration
public override void WriteFinishCollection()
Overrides
WriteFinishObject()
Finishes writing the current element.
Declaration
public override void WriteFinishObject()
Overrides
Remarks
The method writes a closing angle bracket to the output stream.
WriteRawValue(String, Object)
Declaration
public override void WriteRawValue(string name, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
System.Object | value |
Overrides
WriteSerializableObjectValue(String, Object, Object)
Method is not implemented.
Declaration
public override void WriteSerializableObjectValue(string name, object value, object defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
System.Object | value | |
System.Object | defValue |
Overrides
WriteStartCollection(String)
The method is not implemented.
Declaration
public override void WriteStartCollection(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Overrides
WriteStartObject()
Declaration
public override void WriteStartObject()
Overrides
WriteStartObject(String)
Begins to write an item with the specified name to the output stream.
Declaration
public override void WriteStartObject(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the item. |
Overrides
Remarks
The method writes element name and opening angle bracket to the output stream.
WriteValue(Object[])
Method is not implemented.
Declaration
public override void WriteValue(params object[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Object[] | values |
Overrides
WriteValue(String, Boolean, Boolean)
Records the value of the System.Boolean type for a element with the specified name and default value.
Declaration
public override void WriteValue(string name, bool value, bool defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the item. |
System.Boolean | value | The value of the element of the System.Boolean type. |
System.Boolean | defValue | The default value. |
Overrides
WriteValue(String, DateTime, DateTime)
Records the value of the System.DateTime type for a element with the specified name and default value.
Declaration
public override void WriteValue(string name, DateTime value, DateTime defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the item. |
System.DateTime | value | The value of the element of the System.DateTime type. |
System.DateTime | defValue | The default value. |
Overrides
WriteValue(String, Decimal, Decimal)
Records the value of the System.Decimal type for a element with the specified name and default value.
Declaration
public override void WriteValue(string name, decimal value, decimal defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the item. |
System.Decimal | value | The value of the element of the System.Decimal type. |
System.Decimal | defValue | The default value. |
Overrides
WriteValue(String, Double, Double)
Records the value of the System.Double type for a element with the specified name and default value.
Declaration
public override void WriteValue(string name, double value, double defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the item. |
System.Double | value | The value of the element of the System.Double type. |
System.Double | defValue | The default value. |
Overrides
WriteValue(String, Enum, Enum)
Records the value of the System.Enum type for a element with the specified name and default value.
Declaration
public override void WriteValue(string name, Enum value, Enum defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the item. |
System.Enum | value | The value of the element of the System.Enum type. |
System.Enum | defValue | The default value. |
Overrides
WriteValue(String, Guid, Guid)
Records the value of the System.Guid type for a element with the specified name and default value.
Declaration
public override void WriteValue(string name, Guid value, Guid defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the item. |
System.Guid | value | The value of the element of the System.Guid type. |
System.Guid | defValue | The default value. |
Overrides
WriteValue(String, Int32, Int32)
Records the value of the System.Int32 type for a element with the specified name and default value.
Declaration
public override void WriteValue(string name, int value, int defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the item. |
System.Int32 | value | The value of the element of the System.Int32 type. |
System.Int32 | defValue | The default value. |
Overrides
WriteValue(String, Stream)
Writes the element with the specified name and the value from the specified stream.
Declaration
public override void WriteValue(string name, Stream value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the item. |
System.IO.Stream | value | The stream the record is made from. |
Overrides
WriteValue(String, String, String)
Records the value of the System.String type for a element with the specified name and default value.
Declaration
public override void WriteValue(string name, string value, string defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the item. |
System.String | value | The value of the element of the System.String type. |
System.String | defValue | The default value for the element. |
Overrides
WriteValue(String, Type, Object, Object)
Records the value of the specified type for a attribute with the specified name and default value.
Declaration
public override void WriteValue(string name, Type valueType, object value, object defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the item. |
System.Type | valueType | The type of value. |
System.Object | value | Value. |
System.Object | defValue | The default value. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullOrEmptyException | If an empty value or |
UnsupportedTypeException | If the unsupported data type is passed as the |
WriteValue(String, DataConverter, Object, Object)
Records item value with the specified name and value
value, converted with the specified converter
.
Declaration
public override void WriteValue(string name, DataConverter converter, object value, object defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the item. |
DataConverter | converter | Data type converter. |
System.Object | value | Value. |
System.Object | defValue | The default value. |
Overrides
WriteValue(String, LocalizableString, LocalizableString)
Records the value of the LocalizableString type for a element with the specified name and default value.
Declaration
public override void WriteValue(string name, LocalizableString value, LocalizableString defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the item. |
LocalizableString | value | The value of the element of the LocalizableString type. |
LocalizableString | defValue | The default value. |