private void Init(Type recordType) { ChoFileHeaderAttribute recObjAttr = ChoType.GetAttribute <ChoFileHeaderAttribute>(recordType); if (recObjAttr != null) { HasHeaderRecord = true; IgnoreCase = recObjAttr.IgnoreCase; FillChar = recObjAttr.FillChar == '\0' ? ' ' : recObjAttr.FillChar; Justification = recObjAttr.Justification; TrimOption = recObjAttr.TrimOption; } }
private void Init(Type recordType) { ChoFileHeaderAttribute recObjAttr = ChoType.GetAttribute <ChoFileHeaderAttribute>(recordType); if (recObjAttr != null) { HasHeaderRecord = true; IgnoreCase = recObjAttr.IgnoreCase; FillChar = recObjAttr.FillCharInternal; Justification = recObjAttr.JustificationInternal; if (recObjAttr.TrimOptionInternal != null) { TrimOption = recObjAttr.TrimOptionInternal.Value; } Truncate = recObjAttr.TruncateInternal; } }
private void Init(Type recordType) { ChoFileHeaderAttribute recObjAttr = ChoType.GetAttribute <ChoFileHeaderAttribute>(recordType); if (recObjAttr != null) { HasHeaderRecord = true; IgnoreCase = recObjAttr.IgnoreCase; IgnoreHeader = recObjAttr.IgnoreHeader; IgnoreColumnsWithEmptyHeader = recObjAttr.IgnoreColumnsWithEmptyHeader; HeaderLineAt = recObjAttr.HeaderLineAt; FillChar = recObjAttr.FillCharInternal; Justification = recObjAttr.JustificationInternal; QuoteAllHeaders = recObjAttr.QuoteAllInternal; if (recObjAttr.TrimOptionInternal != null) { TrimOption = recObjAttr.TrimOptionInternal.Value; } Truncate = recObjAttr.TruncateInternal; } }
public ChoFileHeaderAttribute GetFileHeaderAttribute(ChoIniFile iniFile) { if (_headerAttr != null) { return(_headerAttr); } lock (_padlock) { if (_headerAttr != null) { return(_headerAttr); } _headerAttr = ChoFileHeaderAttribute.Default; ChoIniFile iniFile1 = iniFile.GetSection("FILE_HEADER"); _headerAttr.FieldValueJustification = iniFile1.GetValue <ChoFieldValueJustification>("FieldValueJustification", _headerAttr.FieldValueJustification, true); _headerAttr.FieldValueTrimOption = iniFile1.GetValue <ChoFieldValueTrimOption>("FieldValueTrimOption", _headerAttr.FieldValueTrimOption, true); _headerAttr.FillChar = iniFile1.GetValue <char>("FillChar", _headerAttr.FillChar, true); _headerAttr.Truncate = iniFile1.GetValue <bool>("Truncate", _headerAttr.Truncate, true); } return(_headerAttr); }