Ejemplo n.º 1
0
        /// <summary>
        /// Read the elements from the XML document for this field
        /// </summary>
        /// <param name="node">XML node to read elements from</param>
        internal override void ReadFieldInternal(XmlNode node)
        {
            XmlNode ele;

            FieldQuoted = node["FieldQuoted"] != null;

            ele = node["QuoteChar"];

            if (ele != null &&
                ele.InnerText.Length > 0)
            {
                QuoteChar = ele.InnerText[0];
            }

            ele = node["QuoteMode"];
            if (ele != null &&
                ele.InnerText.Length > 0)
            {
                QuoteMode = (QuoteMode)Enum.Parse(typeof(QuoteMode), ele.InnerText);
            }

            ele = node["QuoteMultiline"];
            if (ele != null &&
                ele.InnerText.Length > 0)
            {
                QuoteMultiline = (MultilineMode)Enum.Parse(typeof(MultilineMode), ele.InnerText);
            }
        }
        /// <summary>Indicates that the field must be read and written as a Quoted String (that can be optional).</summary>
        /// <param name="quoteChar">The char used to quote the string.</param>
        /// <param name="mode">Indicates if the handling of optionals in the quoted field.</param>
        /// <param name="multiline">Indicates if the field can span multiple lines.</param>
        public FieldQuotedAttribute(char quoteChar, QuoteMode mode, MultilineMode multiline)
        {
            if (quoteChar == '\0')
                throw new BadUsageException("You can't use the null char (\\0) as quoted.");

            QuoteChar = quoteChar;
            QuoteMode = mode;
            QuoteMultiline = multiline;
        }
Ejemplo n.º 3
0
        /// <summary>Indicates that the field must be read and written as a Quoted String (that can be optional).</summary>
        /// <param name="quoteChar">The char used to quote the string.</param>
        /// <param name="mode">Indicates if the handling of optionals in the quoted field.</param>
        /// <param name="multiline">Indicates if the field can span multiple lines.</param>
        public FieldQuotedAttribute(char quoteChar, QuoteMode mode, MultilineMode multiline)
        {
            if (quoteChar == '\0')
            {
                throw new BadUsageException("You can't use the null char (\\0) as quoted.");
            }

            QuoteChar      = quoteChar;
            QuoteMode      = mode;
            QuoteMultiline = multiline;
        }
Ejemplo n.º 4
0
		/// <summary>Indicates that the field must be read and written like a Quoted String with double quotes.</summary>
		/// <param name="multiline">Indicates if the field can span multiple lines.</param>
		public FieldQuotedAttribute(MultilineMode multiline) : this('\"', QuoteMode.OptionalForRead, multiline)
		{}
Ejemplo n.º 5
0
		/// <summary>Indicates that the field must be read and written like a Quoted String (that can be optional).</summary>
		/// <param name="quoteChar">The char used to quote the string.</param>
		/// <param name="mode">Indicates if the handling of optionals in the quoted field.</param>
		/// <param name="multiline">Indicates if the field can span multiple lines.</param>
		public FieldQuotedAttribute(char quoteChar, QuoteMode mode, MultilineMode multiline)
		{
			QuoteChar = quoteChar;
			QuoteMode = mode;
			QuoteMultiline = multiline;
		}
Ejemplo n.º 6
0
		/// <summary>Indicates that the field must be read and written like a Quoted String (that can be optional).</summary>
		/// <param name="mode">Indicates if the handling of optionals in the quoted field.</param>
		/// <param name="multiline">Indicates if the field can span multiple lines.</param>
		public FieldQuotedAttribute(QuoteMode mode, MultilineMode multiline):this('"', mode, multiline)
		{}
        /// <summary>
        /// Read the elements from the XML document for this field
        /// </summary>
        /// <param name="node">XML node to read elements from</param>
        internal override void ReadFieldInternal(XmlNode node)
        {
            XmlNode ele;

            FieldQuoted = node["FieldQuoted"] != null;

            ele = node["QuoteChar"];

            if (ele != null &&
                ele.InnerText.Length > 0)
                QuoteChar = ele.InnerText[0];

            ele = node["QuoteMode"];
            if (ele != null &&
                ele.InnerText.Length > 0)
                QuoteMode = (QuoteMode) Enum.Parse(typeof (QuoteMode), ele.InnerText);

            ele = node["QuoteMultiline"];
            if (ele != null &&
                ele.InnerText.Length > 0)
                QuoteMultiline = (MultilineMode) Enum.Parse(typeof (MultilineMode), ele.InnerText);
        }
Ejemplo n.º 8
0
 /// <summary>Indicates that the field must be read and written as a Quoted String (that can be optional).</summary>
 /// <param name="mode">Indicates if the handling of optionals in the quoted field.</param>
 /// <param name="multiline">Indicates if the field can span multiple lines.</param>
 public FieldQuotedAttribute(QuoteMode mode, MultilineMode multiline)
     : this('"', mode, multiline)
 {
 }
Ejemplo n.º 9
0
 /// <summary>Indicates that the field must be read and written like a Quoted String with double quotes.</summary>
 /// <param name="multiline">Indicates if the field can span multiple lines.</param>
 public FieldQuotedAttribute(MultilineMode multiline)
     : this('\"', QuoteMode.OptionalForRead, multiline)
 {
 }
Ejemplo n.º 10
0
 /// <summary>Indicates that the field must be read and written as a Quoted String (that can be optional).</summary>
 /// <param name="quoteChar">The char used to quote the string.</param>
 /// <param name="mode">Indicates if the handling of optionals in the quoted field.</param>
 /// <param name="multiline">Indicates if the field can span multiple lines.</param>
 public FieldQuotedAttribute(char quoteChar, QuoteMode mode, MultilineMode multiline)
 {
     QuoteChar      = quoteChar;
     QuoteMode      = mode;
     QuoteMultiline = multiline;
 }