public static void Main()
var props = typeof(StateEfileNyBRecordFH).GetFields();
foreach (var prop in props)
var f = Attribute.GetCustomAttribute(prop, typeof(FieldFixedLengthAttribute)) as FieldFixedLengthAttribute;
var c = Attribute.GetCustomAttribute(prop, typeof(FieldConverterAttribute)) as FieldConverterAttribute;
var a = Attribute.GetCustomAttribute(prop, typeof(FieldAlignAttribute)) as FieldAlignAttribute;
Console.WriteLine("[" + f.GetType().Name + "(" + f.Length + ")" + "] // "+ end + "-" + ((end += f.Length)-1));
Console.WriteLine("[" + c.GetType().Name + "(typeof(" + c.Converter.GetType() + "), " + ((dynamic)c.Converter)._size + ")]");
Console.WriteLine("[" + a.GetType().Name + "(AlignMode." + a.Align.ToString() + ", '" + a.AlignChar + "')]");
Console.WriteLine("public " + prop.FieldType.Name + " " + prop.Name + ";");
public class StateEfileNyBRecordFH
public string RecordType;
public string PaymentYear;
public string CorrectReturnIndicator;
public string NameControl;
public string PayeeTaxpayerIdentificationNumber;
public string PayerAccountNumberForPayee;
public string PayerOfficeCode;
public string Blank_45_54;
[FieldConverter(typeof(AmountConverter), 12)]
public decimal PaymentAmount1;
[FieldConverter(typeof(AmountConverter), 12)]
public decimal PaymentAmount2;
[FieldConverter(typeof(AmountConverter), 12)]
public decimal PaymentAmount3;
[FieldConverter(typeof(AmountConverter), 12)]
public decimal PaymentAmount4;
[FieldConverter(typeof(AmountConverter), 12)]
public decimal PaymentAmount5;
[FieldConverter(typeof(AmountConverter), 12)]
public decimal PaymentAmount6;
[FieldConverter(typeof(AmountConverter), 12)]
public decimal PaymentAmount7;
[FieldConverter(typeof(AmountConverter), 12)]
public decimal PaymentAmount8;
[FieldConverter(typeof(AmountConverter), 12)]
public decimal PaymentAmount9;
[FieldConverter(typeof(AmountConverter), 12)]
public decimal PaymentAmountA;
[FieldConverter(typeof(AmountConverter), 12)]
public decimal PaymentAmountB;
[FieldConverter(typeof(AmountConverter), 12)]
public decimal PaymentAmountC;
[FieldConverter(typeof(AmountConverter), 12)]
public decimal PaymentAmountD;
[FieldConverter(typeof(AmountConverter), 12)]
public decimal PaymentAmountE;
[FieldConverter(typeof(AmountConverter), 12)]
public decimal PaymentAmountF;
[FieldConverter(typeof(AmountConverter), 12)]
public decimal PaymentAmountG;
public string ForeignCountryIndicator;
public string FirstPayeeNameLine;
public string SecondPayeeNameLine;
public string Blank_328_367;
public string PayeeMailingAddress;
public string Blank_408_447;
public string PayeeState;
public string PayeeZIPCode;
public string Blank_499_499;
[FieldAlign(AlignMode.Right, '0')]
public int RecordSequenceNumber;
public string Blank_508_555;
public string CUSIPNumber;
public string Description;
public string Blank_608_662;
[FieldAlign(AlignMode.Right, '0')]
public string SpecialDataEntries;
public string Blank_668_750;
public class AmountConverter : ConverterBase
public AmountConverter(string size)
_size = Convert.ToInt32(size);
public AmountConverter(int size)
public override object StringToField(string from)
return from.ToString().PadLeft(_size, '0').Substring(0, _size);
public override string FieldToString(object from)
var amount = Convert.ToDecimal(from);
amount = Math.Abs(amount);
return amount.ToString().PadLeft(_size, '0').Substring(0, _size);