/// <summary> /// .ctor. Creates an instance of this object using the <see cref="IFileLayout">layout</see> provided. /// </summary> /// <param name="layout">The <see cref="IFileLayout">layout</see> to model this instance from.</param> public SerializableLayout(IFileLayout layout) { FillByte = layout.FillByte; FillCharacter = layout.FillCharacter; Name = layout.Name; OpenAsText = layout.OpenAsText; RecordLength = layout.RecordLength; TextLineTerminator = layout.TextLineTerminator; if (layout.MasterFields != null && layout.MasterFields.Length > 0) { System.Collections.Generic.List <SerializableField> fields = new System.Collections.Generic.List <SerializableField>(); foreach (IFileField field in layout.MasterFields.OrderBy(x => x.StartPosition)) { fields.Add(new SerializableField(field)); } MasterFields = fields.ToArray(); } if (layout.HeaderRecord != null && layout.HeaderRecord.Fields != null && layout.HeaderRecord.Fields.Length > 0) { System.Collections.Generic.List <SerializableField> fields = new System.Collections.Generic.List <SerializableField>(); foreach (IFileField field in layout.HeaderRecord.Fields.OrderBy(x => x.StartPosition)) { fields.Add(new SerializableField(field)); } HeaderFields = fields.ToArray(); } if (layout.FooterRecord != null && layout.FooterRecord.Fields != null && layout.FooterRecord.Fields.Length > 0) { System.Collections.Generic.List <SerializableField> fields = new System.Collections.Generic.List <SerializableField>(); foreach (IFileField field in layout.FooterRecord.Fields.OrderBy(x => x.StartPosition)) { fields.Add(new SerializableField(field)); } FooterFields = fields.ToArray(); } }
public FileWriter(IFileLayout layout) { _layout = layout; }
/// <summary> /// .ctor. Creates a new instance of FileParser. /// </summary> /// <param name="layout">The <see cref="IFileLayout">layout</see> instance to use for processing.</param> public FileParser(IFileLayout layout) : base(layout) { records = new List <IFileRecord>(); }
/// <summary> /// .ctor. Must be inherited. /// </summary> /// <param name="layout">The <see cref="IFileLayout">layout</see> instance to use for processing.</param> public FileParserBase(IFileLayout layout) : this() { Layout = layout; }
/// <summary> /// .ctor. Must be inherited. /// </summary> /// <param name="encoder">The <see cref="IFileParserEncoder">IFileParserEncoder</see> instance to use for encoding.</param> public FileParserBase(IFileParserEncoder encoder) : this() { Layout = new FileLayout(encoder); }
public HtmlWriter(IFileLayout layout) { _layout = layout; }