#region " © Copyright 2005-07 to Marcos Meli - http://www.marcosmeli.com.ar"
// Errors, suggestions, contributions, send a mail to: marcos@filehelpers.com.
#endregion
using System;
using System.ComponentModel;
namespace FileHelpers
{
/// Indicates that the field must be read and written like a Quoted String. (by default "")
/// See the Complete Attributes List for more clear info and examples of each one.
/// Attributes List
/// Quick Start Guide
/// Examples of Use
[AttributeUsage(AttributeTargets.Field)]
public sealed class FieldQuotedAttribute : Attribute
{
internal char QuoteChar;
internal QuoteMode QuoteMode = QuoteMode.AlwaysQuoted;
internal MultilineMode QuoteMultiline = MultilineMode.AllowForBoth;
/// Indicates that the field must be read and written like a Quoted String with double quotes.
public FieldQuotedAttribute() : this('\"')
{
}
/// Indicates that the field must be read and written like a Quoted String with the specified char.
/// The char used to quote the string.
public FieldQuotedAttribute(char quoteChar):this(quoteChar, QuoteMode.OptionalForRead, MultilineMode.AllowForBoth)
{
}
/// Indicates that the field must be read and written like a "Quoted String" (that can be optional depending of the mode).
/// Indicates if the handling of optionals in the quoted field.
public FieldQuotedAttribute(QuoteMode mode) : this('\"', mode)
{}
/// Indicates that the field must be read and written like a Quoted String (that can be optional).
/// Indicates if the handling of optionals in the quoted field.
/// Indicates if the field can span multiple lines.
public FieldQuotedAttribute(QuoteMode mode, MultilineMode multiline):this('"', mode, multiline)
{}
/// Indicates that the field must be read and written like a Quoted String (that can be optional).
/// The char used to quote the string.
/// Indicates if the handling of optionals in the quoted field.
public FieldQuotedAttribute(char quoteChar, QuoteMode mode):this(quoteChar, mode, MultilineMode.AllowForBoth)
{}
/// Indicates that the field must be read and written like a Quoted String (that can be optional).
/// The char used to quote the string.
/// Indicates if the handling of optionals in the quoted field.
/// Indicates if the field can span multiple lines.
public FieldQuotedAttribute(char quoteChar, QuoteMode mode, MultilineMode multiline)
{
QuoteChar = quoteChar;
QuoteMode = mode;
QuoteMultiline = multiline;
}
/// Indicates that the field must be read and written like a Quoted String with double quotes.
/// Indicates if the field can span multiple lines.
public FieldQuotedAttribute(MultilineMode multiline) : this('\"', QuoteMode.OptionalForRead, multiline)
{}
}
}