private void AddAttributesInternal(AttributesBuilder attbs, NetLanguage lang) { if (mIgnoreFirstLines != 0) { attbs.AddAttribute("IgnoreFirst(" + mIgnoreFirstLines.ToString() + ")"); } if (mIgnoreLastLines != 0) { attbs.AddAttribute("IgnoreLast(" + mIgnoreLastLines.ToString() + ")"); } if (mIgnoreEmptyLines) { attbs.AddAttribute("IgnoreEmptyLines()"); } if (mRecordConditionInfo.Condition != Enums.RecordCondition.None) { attbs.AddAttribute("ConditionalRecord(RecordCondition." + mRecordConditionInfo.Condition.ToString() + ", \"" + mRecordConditionInfo.Selector + "\")"); } if (mIgnoreCommentInfo.CommentMarker != null && mIgnoreCommentInfo.CommentMarker.Length > 0) { attbs.AddAttribute("IgnoreCommentedLines(\"" + mIgnoreCommentInfo.CommentMarker + "\", " + mIgnoreCommentInfo.InAnyPlace.ToString().ToLower() + ")"); } }
internal override void AddAttributesCode(AttributesBuilder attbs, NetLanguage leng) { if (mFieldQuoted) { if (leng == NetLanguage.CSharp) { var quoteStr = mQuoteChar.ToString(); if (mQuoteChar == '\'') { quoteStr = @"\'"; } attbs.AddAttribute("FieldQuoted('" + quoteStr + "', QuoteMode." + mQuoteMode.ToString() + ", MultilineMode." + mQuoteMultiline.ToString() + ")"); } else if (leng == NetLanguage.VbNet) { var quoteStr = mQuoteChar.ToString(); if (mQuoteChar == '"') { quoteStr = "\"\""; } attbs.AddAttribute("FieldQuoted(\"" + quoteStr + "\"c, QuoteMode." + mQuoteMode.ToString() + ", MultilineMode." + mQuoteMultiline.ToString() + ")"); } } }
internal override void AddAttributesCode(AttributesBuilder attbs, NetLanguage lang) { if (mFieldLength <= 0) throw new BadUsageException("The Length of each field must be grater than 0"); else attbs.AddAttribute("FieldFixedLength(" + mFieldLength.ToString() + ")"); if (mAlignMode != AlignMode.Left) { if (lang == NetLanguage.CSharp) attbs.AddAttribute("FieldAlign(AlignMode." + mAlignMode.ToString() + ", '" + mAlignChar.ToString() + "')"); else if (lang == NetLanguage.VbNet) attbs.AddAttribute("FieldAlign(AlignMode." + mAlignMode.ToString() + ", \"" + mAlignChar.ToString() + "\"c)"); } }
private void AddAttributesInternal(AttributesBuilder attbs, NetLanguage leng) { if (mFieldOptional) { attbs.AddAttribute("FieldOptional()"); } if (mFieldIgnored) { attbs.AddAttribute("FieldIgnored()"); } if (mFieldInNewLine) { attbs.AddAttribute("FieldInNewLine()"); } if (mFieldNullValue != null) { if (mFieldNullValue is string) { attbs.AddAttribute("FieldNullValue(\"" + mFieldNullValue + "\")"); } else { var t = mFieldNullValue.GetType().FullName; var gt = string.Empty; if (leng == NetLanguage.CSharp) { gt = "typeof(" + t + ")"; } else if (leng == NetLanguage.VbNet) { gt = "GetType(" + t + ")"; } attbs.AddAttribute("FieldNullValue(" + gt + ", \"" + mFieldNullValue + "\")"); } } attbs.AddAttribute(mConverter.GetConverterCode(leng)); if (mTrimMode != TrimMode.None) { if (" \t" == mTrimChars) { attbs.AddAttribute("FieldTrim(TrimMode." + mTrimMode.ToString() + ")"); } else { attbs.AddAttribute("FieldTrim(TrimMode." + mTrimMode.ToString() + ", \"" + mTrimChars + "\")"); } } }
internal override void AddAttributesCode(AttributesBuilder attbs, NetLanguage leng) { if (mDelimiter == string.Empty) { throw new BadUsageException("The Delimiter of the DelimiterClassBuilder can't be null or empty."); } else { attbs.AddAttribute("DelimitedRecord(\"" + mDelimiter + "\")"); } }
internal override void AddAttributesCode(AttributesBuilder attbs, NetLanguage lang) { if (mFieldLength <= 0) { throw new BadUsageException("The Length of each field must be grater than 0"); } else { attbs.AddAttribute("FieldFixedLength(" + mFieldLength.ToString() + ")"); } if (mAlignMode != AlignMode.Left) { if (lang == NetLanguage.CSharp) { attbs.AddAttribute("FieldAlign(AlignMode." + mAlignMode.ToString() + ", '" + mAlignChar.ToString() + "')"); } else if (lang == NetLanguage.VbNet) { attbs.AddAttribute("FieldAlign(AlignMode." + mAlignMode.ToString() + ", \"" + mAlignChar.ToString() + "\"c)"); } } }
internal override void AddAttributesCode(AttributesBuilder attbs, NetLanguage leng) { if (mFieldQuoted) { if (leng == NetLanguage.CSharp) { var quoteStr = mQuoteChar.ToString(); if (mQuoteChar == '\'') quoteStr = @"\'"; attbs.AddAttribute("FieldQuoted('" + quoteStr + "', QuoteMode." + mQuoteMode.ToString() + ", MultilineMode." + mQuoteMultiline.ToString() + ")"); } else if (leng == NetLanguage.VbNet) { var quoteStr = mQuoteChar.ToString(); if (mQuoteChar == '"') quoteStr = "\"\""; attbs.AddAttribute("FieldQuoted(\"" + quoteStr + "\"c, QuoteMode." + mQuoteMode.ToString() + ", MultilineMode." + mQuoteMultiline.ToString() + ")"); } } }
internal override void AddAttributesCode(AttributesBuilder attbs, NetLanguage leng) { attbs.AddAttribute("FixedLengthRecord(FixedMode." + mFixedMode.ToString() + ")"); }
internal override void AddAttributesCode(AttributesBuilder attbs, NetLanguage leng) { attbs.AddAttribute("FixedLengthRecord(FixedMode." + mFixedMode.ToString() + ")"); }
private void AddAttributesInternal(AttributesBuilder attbs, NetLanguage leng) { if (mFieldOptional) attbs.AddAttribute("FieldOptional()"); if (mFieldIgnored) attbs.AddAttribute("FieldIgnored()"); if (mFieldInNewLine) attbs.AddAttribute("FieldInNewLine()"); if (mFieldNullValue != null) { if (mFieldNullValue is string) attbs.AddAttribute("FieldNullValue(\"" + mFieldNullValue + "\")"); else { var t = mFieldNullValue.GetType().FullName; var gt = string.Empty; if (leng == NetLanguage.CSharp) gt = "typeof(" + t + ")"; else if (leng == NetLanguage.VbNet) gt = "GetType(" + t + ")"; attbs.AddAttribute("FieldNullValue(" + gt + ", \"" + mFieldNullValue + "\")"); } } attbs.AddAttribute(mConverter.GetConverterCode(leng)); if (mTrimMode != TrimMode.None) { if (" \t" == mTrimChars) attbs.AddAttribute("FieldTrim(TrimMode." + mTrimMode.ToString() + ")"); else attbs.AddAttribute("FieldTrim(TrimMode." + mTrimMode.ToString() + ", \"" + mTrimChars + "\")"); } }
internal override void AddAttributesCode(AttributesBuilder attbs, NetLanguage leng) { if (mDelimiter == string.Empty) throw new BadUsageException("The Delimiter of the DelimiterClassBuilder can't be null or empty."); else attbs.AddAttribute("DelimitedRecord(\"" + mDelimiter + "\")"); }
private void AddAttributesInternal(AttributesBuilder attbs, NetLanguage lang) { if (mIgnoreFirstLines != 0) attbs.AddAttribute("IgnoreFirst(" + mIgnoreFirstLines.ToString() + ")"); if (mIgnoreLastLines != 0) attbs.AddAttribute("IgnoreLast(" + mIgnoreLastLines.ToString() + ")"); if (mIgnoreEmptyLines) attbs.AddAttribute("IgnoreEmptyLines()"); if (mRecordConditionInfo.Condition != Enums.RecordCondition.None) attbs.AddAttribute("ConditionalRecord(RecordCondition." + mRecordConditionInfo.Condition.ToString() + ", \"" + mRecordConditionInfo.Selector + "\")"); if (mIgnoreCommentInfo.CommentMarker != null && mIgnoreCommentInfo.CommentMarker.Length > 0) attbs.AddAttribute("IgnoreCommentedLines(\"" + mIgnoreCommentInfo.CommentMarker + "\", " + mIgnoreCommentInfo.InAnyPlace.ToString().ToLower() + ")"); }