Skip to content

Recommended Usage

Michael Scribellito edited this page Jul 20, 2018 · 5 revisions

TextSerializable Attribute

Options

Name Type Description Default
ZeroBased bool Specifies if field positions are zero based or not. false

Create a serializer with zero-based indexes:

[TextSerializable(ZeroBased = true)]
public class ZeroBased
{
...

TextField Attribute

Options

Name Type Description Default
Position int Position of text field. -
Size int Size of text field. -
Padding char Character used to pad text field. ' '
Alignment TextAlignment Text alignment of field. TextAlignment.Left
FormatterType Type Type to be utilized for deserialze/serialize. -

Position & Size

[TextField(1, 10)]
public string Name { get; set; }

Padding & Alignment

[TextField(12, 3,
    Padding = '0',
    Alignment = TextAlignment.Right)]
public int Weight { get; set; }

FormatterType

[TextField(23, 1,
    FormatterType = typeof(BooleanFormatter))]
public bool SpayedNeutered { get; set; }

Next >> Custom Formatters

Clone this wiki locally