Interface IDataWriter
The base interface for classes that implements sequential data writing.
Inherited Members
Namespace: Terrasoft.Common.Data
Assembly: Terrasoft.Common.dll
Syntax
public interface IDataWriter : IDisposable
Methods
Close()
Closes the current instance DataWriter.
Declaration
void Close()
WriteFinishCollection()
Ends recording the current collection.
Declaration
void WriteFinishCollection()
WriteFinishObject()
Finishes writing the item to the output stream.
Declaration
void WriteFinishObject()
WriteSerializableObjectValue(String, Object, Object)
Serializes and writes a given object as value.
Declaration
void WriteSerializableObjectValue(string name, object value, object defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the element. |
System.Object | value | Value. |
System.Object | defValue | Default value. |
WriteStartCollection(String)
Starts recording the collection with the given name.
Declaration
void WriteStartCollection(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the collection. |
WriteStartObject()
Writes the root element to the output stream.
Declaration
void WriteStartObject()
WriteStartObject(String)
Writes the root element with the specified name to the output stream.
Declaration
void WriteStartObject(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the root element. |
WriteValue(Object[])
Writes a given array of values.
Declaration
void WriteValue(params object[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Object[] | values | An array of values. |
Remarks
Overloaded method.
WriteValue(String, Boolean, Boolean)
Writes the value of an element with a given name and a given default value (for boolean values).
Declaration
void WriteValue(string name, bool value, bool defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the element. |
System.Boolean | value | The value of an element of type System.bool. |
System.Boolean | defValue | The default value for the item. |
Remarks
Overloaded method.
WriteValue(String, DateTime, DateTime)
Writes the value of an element with a given name and a given default value (for DateTime values).
Declaration
void WriteValue(string name, DateTime value, DateTime defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the element. |
System.DateTime | value | The value of an element of type System.DateTime. |
System.DateTime | defValue | The default value for the item. |
Remarks
Overloaded method.
WriteValue(String, Decimal, Decimal)
Writes the value of an element with a given name and a given default value (for decimal values).
Declaration
void WriteValue(string name, decimal value, decimal defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the element. |
System.Decimal | value | The value of an element of type System.decimal. |
System.Decimal | defValue | The default value for the item. |
Remarks
Overloaded method.
WriteValue(String, Double, Double)
Writes the value of an element with a given name and a given default value (for double values).
Declaration
void WriteValue(string name, double value, double defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the element. |
System.Double | value | The value of an element of type System.double. |
System.Double | defValue | The default value for the item. |
Remarks
Overloaded method.
WriteValue(String, Enum, Enum)
Writes the value of an element with a given name and a given default value (for enum values).
Declaration
void WriteValue(string name, Enum value, Enum defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the element. |
System.Enum | value | The value of an element of type System.Enum. |
System.Enum | defValue | The default value for the item. |
Remarks
Overloaded method.
WriteValue(String, Guid, Guid)
Writes the value of an element with a given name and a given default value (for guid values).
Declaration
void WriteValue(string name, Guid value, Guid defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the element. |
System.Guid | value | The value of an element of type System.Guid. |
System.Guid | defValue | The default value for the item. |
Remarks
Overloaded method.
WriteValue(String, Int32, Int32)
Writes the value of an element with a given name and a given default value (for int values).
Declaration
void WriteValue(string name, int value, int defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the element. |
System.Int32 | value | The value of an element of type System.Int32. |
System.Int32 | defValue | The default value for the item. |
Remarks
Overloaded method.
WriteValue(String, Stream)
Writes the value of the element with the given name and the values from the specified stream.
Declaration
void WriteValue(string name, Stream value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the element. |
System.IO.Stream | value | The stream from which the recording is made. |
Remarks
Overloaded method.
WriteValue(String, String, String)
Writes the value of an element with a given name and a given default value (for string values).
Declaration
void WriteValue(string name, string value, string defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the element. |
System.String | value | The value of an element of type System.String. |
System.String | defValue | The default value for the item. |
Remarks
Overloaded method.
WriteValue(String, Type, Object, Object)
Writes the value of an element with a given name and a given default value, converted to the specified type.
Declaration
void WriteValue(string name, Type valueType, object value, object defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the element. |
System.Type | valueType | Value type. |
System.Object | value | Value. |
System.Object | defValue | Default value. |
Remarks
Overloaded method.
WriteValue(String, DataConverter, Object, Object)
Writes the value of an element with a given name and a given default value, transformed in accordance with the specified type of transformation.
Declaration
void WriteValue(string name, DataConverter converter, object value, object defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the element. |
DataConverter | converter | Transformation type. |
System.Object | value | Value. |
System.Object | defValue | Default value. |
Remarks
Overloaded method.
WriteValue(String, LocalizableString, LocalizableString)
Writes the value of an element with a given name and a given default value (for localizable string values).
Declaration
void WriteValue(string name, LocalizableString value, LocalizableString defValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the element. |
LocalizableString | value | The value of an element of type Terrasoft.LocalizableString. |
LocalizableString | defValue | The default value for the item. |
Remarks
Overloaded method.