TextFieldAttribute class
This attribute is applied to Fields or Properties of a class to control where in the CSV file this field belongs.
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
public class TextFieldAttribute : Attribute
Public Members
| name | description |
|---|---|
| TextFieldAttribute() | Default constructor. |
| TextFieldAttribute(…) | Default constructor. |
| FormatterType { get; set; } | Optional class which is used to control custom serialization/deserialization of this field. This class must implement the ITextFormatter interface. |
| Name { get; set; } | Name of this field. If not specified, then the property/field name of the class/struct is used. If a header is written to the CSV file, then this is the value that is used. |
| Optional { get; set; } | Determines whether this field is optional. Because of the nature of CSV and FixedWidth file formats, optional fields should only be a the end of the record. |
| Position { get; set; } | Position (column) where this field is serialized in the CSV file. |
| Size { get; set; } | Maximum length in the CSV file that this field should take up. |
See Also
- namespace TheCodingMonkey.Serialization