Click or drag to resize

CsvColumnAttribute Class

This attribute defines how a property must be serialized and deserialized to and from a column in a CSV file.
Inheritance Hierarchy
SystemObject
  SystemAttribute
    Enkoni.Framework.SerializationCsvColumnAttribute

Namespace:  Enkoni.Framework.Serialization
Assembly:  Enkoni.Framework.Serialization (in Enkoni.Framework.Serialization.dll) Version: 1.3.0.1
Syntax
[AttributeUsageAttribute(AttributeTargets.Property)]
public sealed class CsvColumnAttribute : Attribute

The CsvColumnAttribute type exposes the following members.

Constructors
  NameDescription
Public methodCsvColumnAttribute
Initializes a new instance of the CsvColumnAttribute class using a default field index.
Public methodCsvColumnAttribute(Int32)
Initializes a new instance of the CsvColumnAttribute class.
Top
Properties
  NameDescription
Public propertyCultureName
Gets or sets the name of the culture that must be used to parse the field value. If this property is set, it overrides any culture-settings that may have been set in the CsvRecord-attribute.
Public propertyFieldIndex
Gets the index of the field in the CSV file.
Public propertyFormatString
Gets or sets the format string that is to be used when parsing the column value.
De following format strings are supported:
  • XXX - Serialize the property according to the format. I.e.: '000' in combination with integer value 7 results in "007".
  • [prefix]{0:XXX}[postfix] - Serialize the property according to the format. I.e.: 'a{0:000}b' in combination with integer value 7 results in "a007b".
  • X or -X (String properties only) - Serialize the property according to the format. I.e.: '-5' in combination with string value 'abc' results in "abc ".
  • [prefix]{0,X}[postfix] or [prefix]{0,-X}[postfix] (String properties only) - Serialize the property according to the format. I.e.: 'y{0,-5}z' in combination with string value 'abc' results in "yabc z".
  • true:[true string]|false:[false string] (Boolean properties only) - Serialize the property according to the format. I.e.: 'true:Y|false:N' in combination with boolean value 'True' results in "Y".
Public propertyNullString
Gets or sets the string that is used to identify a null-value. During serialization, this value is used when the property to which this attribute is applied equals . During deserialization, if the serialized value equals this null-string, or the default value is used.
Top
Methods
  NameDescription
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 methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also