Click or drag to resize

CsvSerializerT Class

Serializes or deserializes a list of objects to and from a CSV file.
Inheritance Hierarchy
SystemObject
  Enkoni.Framework.SerializationSerializerT
    Enkoni.Framework.SerializationCsvSerializerT

Namespace:  Enkoni.Framework.Serialization
Assembly:  Enkoni.Framework.Serialization (in Enkoni.Framework.Serialization.dll) Version: 1.3.0.1
Syntax
public class CsvSerializer<T> : Serializer<T>
where T : new()

Type Parameters

T
Type of the object that has to be serialized.

The CsvSerializerT type exposes the following members.

Constructors
  NameDescription
Public methodCsvSerializerT
Initializes a new instance of the CsvSerializerT class.
Top
Properties
  NameDescription
Protected propertyColumnNameMappings
Gets the mappings of the column names. The dictionary uses the column index as key and column name as value.
Public propertyDefaultEncoding
Gets or sets the default encoding that will be used when no encoding is specified.
(Inherited from SerializerT.)
Protected propertyEmitHeader
Gets or sets a value indicating whether a header-line must be included when serializing the objects.
Protected propertyIgnoreHeaderOnRead
Gets or sets a value indicating whether the header should be ignored when reading the file.
Protected propertySeparator
Gets or sets the separator-string.
Protected propertyTransformer
Gets or sets the transformer that transforms single objects into a specific format.
(Inherited from SerializerT.)
Top
Methods
  NameDescription
Public methodBeginDeserialize(Stream, AsyncCallback, Object)
Begins to deserialize the objects from the specified stream using a default encoding.
(Inherited from SerializerT.)
Public methodBeginDeserialize(String, AsyncCallback, Object)
Begins to deserialize the objects from the specified file using a default encoding.
(Inherited from SerializerT.)
Public methodBeginDeserialize(Stream, Encoding, AsyncCallback, Object)
Begins to deserialize the objects from the specified stream using the specified encoding.
(Inherited from SerializerT.)
Public methodBeginDeserialize(String, Encoding, AsyncCallback, Object)
Begins to deserialize the objects from the specified file using the specified encoding.
(Inherited from SerializerT.)
Public methodBeginSerialize(IEnumerableT, Stream, AsyncCallback, Object)
Begins to serialize the objects to the specified stream using a default encoding.
(Inherited from SerializerT.)
Public methodBeginSerialize(IEnumerableT, String, AsyncCallback, Object)
Begins to serialize the objects to the specified file using a default encoding.
(Inherited from SerializerT.)
Public methodBeginSerialize(IEnumerableT, Stream, Encoding, AsyncCallback, Object)
Begins to serialize the objects to the specified stream using the specified encoding.
(Inherited from SerializerT.)
Public methodBeginSerialize(IEnumerableT, String, Encoding, AsyncCallback, Object)
Begins to serialize the objects to the specified file using the specified encoding.
(Inherited from SerializerT.)
Protected methodDeserialize(StreamReader)
Deserializes a collection of objects using the data that is accessible through the specified stream reader.
(Overrides SerializerTDeserialize(StreamReader).)
Public methodDeserialize(Stream)
Deserializes CSV data to a list of objects using a default encoding of UTF-8.
(Inherited from SerializerT.)
Public methodDeserialize(String)
Deserializes a CSV to a list of objects using a default encoding of UTF-8.
(Inherited from SerializerT.)
Public methodDeserialize(Stream, Encoding)
Deserializes a CSV to a list of objects.
(Inherited from SerializerT.)
Public methodDeserialize(String, Encoding)
Deserializes a CSV to a list of objects.
(Inherited from SerializerT.)
Public methodEndDeserialize
Waits for the pending asynchronous deserialize operation to complete. If an exception was thrown during the execution of the asynchronous operation, it is rethrown when invoking this method.
(Inherited from SerializerT.)
Public methodEndSerialize
Waits for the pending asynchronous serialize operation to complete. If an exception was thrown during the execution of the asynchronous operation, it is rethrown when invoking this method.
(Inherited from SerializerT.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSerialize(IEnumerableT, Stream)
Serializes a list of objects to a stream using a default encoding.
(Inherited from SerializerT.)
Public methodSerialize(IEnumerableT, String)
Serializes a list of objects to a file using a default encoding.
(Inherited from SerializerT.)
Protected methodSerialize(IEnumerableT, Encoding, Stream)
Serializes a collection of items by transforming each item using the Transformer property and writing the transformed item to the stream. Each item will be separated using the new line character(s) of the current environment.
(Overrides SerializerTSerialize(IEnumerableT, Encoding, Stream).)
Public methodSerialize(IEnumerableT, Stream, Encoding)
Serializes a list of objects to a stream.
(Inherited from SerializerT.)
Public methodSerialize(IEnumerableT, String, Encoding)
Serializes a list of objects to a file.
(Inherited from SerializerT.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also