/// <summary> /// Create a fixed length field from field information /// </summary> /// <param name="fi">Field definitions</param> /// <param name="length">Length of this field</param> /// <param name="align">Alignment, left or right</param> internal FixedLengthField(FieldInfo fi, int length, FieldAlignAttribute align) : base(fi) { FixedMode = FixedMode.ExactLength; Align = new FieldAlignAttribute(AlignMode.Left, ' '); this.FieldLength = length; if (align != null) this.Align = align; else { if (TypeHelper.IsNumericType(fi.FieldType)) Align = new FieldAlignAttribute(AlignMode.Right, ' '); } }
/// <summary> /// Create a fixed length field from field information /// </summary> /// <param name="fi">Field definitions</param> /// <param name="length">Length of this field</param> /// <param name="align">Alignment, left or right</param> internal FixedLengthField(FieldInfo fi, int length, FieldAlignAttribute align) : base(fi) { FixedMode = FixedMode.ExactLength; Align = new FieldAlignAttribute(AlignMode.Left, ' '); FieldLength = length; if (align != null) { Align = align; } else { if (TypeHelper.IsNumericType(fi.FieldType)) { Align = new FieldAlignAttribute(AlignMode.Right, ' '); } } }
/// <summary> /// Indicates that this class represents a fixed length record with the /// specified variable length record behavior. /// </summary> /// <param name="fixedMode">The <see cref="FileHelpers.FixedMode"/> used for variable length records. By Default is FixedMode.ExactLength</param> public FixedLengthRecordAttribute(FixedMode fixedMode) { FixedMode = fixedMode; }
/// <summary>Used to create classes that maps to Fixed Length records.</summary> /// <param name="className">A valid class name.</param> /// <param name="mode">Indicates the behavior when variable length records are found.</param> public FixedLengthClassBuilder(string className, FixedMode mode) : base(className) { mFixedMode = mode; }
/// <summary>Indicates that this class represents a fixed length record with the specified variable record behavior.</summary> /// <param name="mode">The <see cref="FixedMode"/> used for variable length records.</param> public FixedLengthRecordAttribute(FixedMode mode) { mFixedMode = mode; }
/// <summary> /// Indicates that this class represents a fixed length record with the /// specified variable length record behavior. /// </summary> /// <param name="fixedMode">The <see cref="FileHelpers.FixedMode"/> used for variable length records. By Default is FixedMode.ExactLength</param> /// <param name="defaultCultureName">Default culture name used for each properties if no converter is specified otherwise. If null, the default decimal separator (".") will be used.</param> public FixedLengthRecordAttribute(FixedMode fixedMode, string defaultCultureName = null) : base(defaultCultureName: defaultCultureName) { FixedMode = fixedMode; }