/// <summary>
        /// serialize converter attribute details to XML
        /// </summary>
        /// <param name="writer">XML writer</param>
        internal void WriteXml(XmlHelper writer)
        {
            if (mKind == ConverterKind.None &&
                mTypeName == string.Empty)
                return;

            writer.Writer.WriteStartElement("Converter");

            writer.WriteAttribute("Kind", Kind.ToString(), "None");
            writer.WriteAttribute("TypeName", mTypeName.ToString(), string.Empty);

            writer.WriteAttribute("Arg1", Arg1, string.Empty);
            writer.WriteAttribute("Arg2", Arg2, string.Empty);
            writer.WriteAttribute("Arg3", Arg3, string.Empty);

            writer.Writer.WriteEndElement();
        }
 /// <summary>
 /// Write the elements for this field to the XML
 /// </summary>
 /// <param name="writer"></param>
 internal override void WriteExtraElements(XmlHelper writer)
 {
     writer.WriteElement("FieldQuoted", this.FieldQuoted);
     writer.WriteElement("QuoteChar", this.QuoteChar.ToString(), "\"");
     writer.WriteElement("QuoteMode", this.QuoteMode.ToString(), "OptionalForRead");
     writer.WriteElement("QuoteMultiline", this.QuoteMultiline.ToString(), "AllowForRead");
 }
 /// <summary>
 /// Write any header attributes - not used
 /// </summary>
 /// <param name="writer">XML writer to add element to</param>
 internal override void WriteHeaderAttributes(XmlHelper writer) {}
 /// <summary>
 /// Serialise attributes for field to the XML 
 /// </summary>
 /// <param name="writer"></param>
 internal override void WriteHeaderAttributes(XmlHelper writer)
 {
     writer.mWriter.WriteStartAttribute("Length", "");
     writer.mWriter.WriteString(mFieldLength.ToString());
     writer.mWriter.WriteEndAttribute();
 }
 /// <summary>
 /// Write any extra elements to the code
 /// </summary>
 /// <param name="writer">XML writer to serialise to</param>
 internal override void WriteExtraElements(XmlHelper writer)
 {
     writer.WriteElement("AlignMode", this.AlignMode.ToString(), "Left");
     writer.WriteElement("AlignChar", this.AlignChar.ToString(), " ");
 }
 /// <summary>
 /// Serialise the XML header
 /// </summary>
 /// <param name="writer">Writer to serialise to</param>
 internal override void WriteHeaderElement(XmlHelper writer)
 {
     writer.Writer.WriteStartElement("DelimitedClass");
     writer.Writer.WriteStartAttribute("Delimiter", "");
     writer.Writer.WriteString(this.Delimiter);
     writer.Writer.WriteEndAttribute();
 }
 /// <summary>
 /// Write any extra elements (not used)
 /// </summary>
 /// <param name="writer"></param>
 internal override void WriteExtraElements(XmlHelper writer)
 {
 }
Example #8
0
 internal abstract void WriteHeaderAttributes(XmlHelper writer);
Example #9
0
 internal abstract void WriteExtraElements(XmlHelper writer);
Example #10
0
        internal void SaveToXml(XmlHelper writer)
        {
            writer.mWriter.WriteStartElement("Field");
            writer.mWriter.WriteStartAttribute("Name", "");
            writer.mWriter.WriteString(mFieldName);
            writer.mWriter.WriteEndAttribute();
            writer.mWriter.WriteStartAttribute("Type", "");
            writer.mWriter.WriteString(mFieldType);
            writer.mWriter.WriteEndAttribute();
            WriteHeaderAttributes(writer);

            Converter.WriteXml(writer);

            writer.WriteElement("Visibility", this.Visibility.ToString(), "Public");
            writer.WriteElement("FieldIgnored", this.FieldIgnored);
            writer.WriteElement("FieldOptional", this.FieldOptional);
            writer.WriteElement("FieldInNewLine", this.FieldInNewLine);
            writer.WriteElement("TrimChars", this.TrimChars, " \t");
            writer.WriteElement("TrimMode", this.TrimMode.ToString(), "None");

            if (FieldNullValue != null)
            {
                writer.mWriter.WriteStartElement("FieldNullValue");
                writer.mWriter.WriteStartAttribute("Type", "");
                writer.mWriter.WriteString(ClassBuilder.TypeToString(mFieldNullValue.GetType()));
                writer.mWriter.WriteEndAttribute();

                writer.mWriter.WriteString(mFieldNullValue.ToString());

                writer.mWriter.WriteEndElement();
            }

            WriteExtraElements(writer);
            writer.mWriter.WriteEndElement();
        }
 /// <summary>
 /// write the fixed length XML to document
 /// </summary>
 /// <param name="writer">writer to put XML on</param>
 internal override void WriteHeaderElement(XmlHelper writer)
 {
     writer.mWriter.WriteStartElement("FixedLengthClass");
     writer.mWriter.WriteStartAttribute("FixedMode", "");
     writer.mWriter.WriteString(mFixedMode.ToString());
     writer.mWriter.WriteEndAttribute();
 }
 /// <summary>
 /// write header information for this class
 /// </summary>
 /// <param name="writer">writer to write on</param>
 internal abstract void WriteHeaderElement(XmlHelper writer);
        /// <summary>
        /// Save to a TextWriter the XML representation of the current record class.
        /// </summary>
        /// <param name="writer">The TextWriter for the output Stream.</param>
        public void SaveToXml(TextWriter writer)
        {
            XmlHelper xml = new XmlHelper();

            xml.BeginWriteStream(writer);

            WriteHeaderElement(xml);

            xml.WriteElement("ClassName", ClassName);
            xml.WriteElement("Namespace", this.Namespace, string.Empty);

            xml.WriteElement("SealedClass", this.SealedClass);
            xml.WriteElement("Visibility", this.Visibility.ToString(), "Public");

            xml.WriteElement("IgnoreEmptyLines", this.IgnoreEmptyLines);
            xml.WriteElement("IgnoreFirstLines", this.IgnoreFirstLines.ToString(), "0");
            xml.WriteElement("IgnoreLastLines", this.IgnoreLastLines.ToString(), "0");

            xml.WriteElement("CommentMarker", this.IgnoreCommentedLines.CommentMarker, string.Empty);
            xml.WriteElement("CommentInAnyPlace", this.IgnoreCommentedLines.InAnyPlace.ToString().ToLower(), true.ToString().ToLower());

            xml.WriteElement("RecordCondition", this.RecordCondition.Condition.ToString(), "None");
            xml.WriteElement("RecordConditionSelector", this.RecordCondition.Selector, string.Empty);

            WriteExtraElements(xml);

            xml.mWriter.WriteStartElement("Fields");

            for (int i = 0; i < mFields.Count; i++)
                ((FieldBuilder)mFields[i]).SaveToXml(xml);

            xml.mWriter.WriteEndElement();

            xml.mWriter.WriteEndElement();
            xml.EndWrite();
        }
Example #14
0
 /// <summary>
 /// Write any extra elements (not used)
 /// </summary>
 /// <param name="writer"></param>
 internal override void WriteExtraElements(XmlHelper writer)
 {
 }
 /// <summary>
 /// Write any header attributes - not used
 /// </summary>
 /// <param name="writer">XML writer to add element to</param>
 internal override void WriteHeaderAttributes(XmlHelper writer)
 {
 }