protected override void WriteXml(System.Xml.XmlWriter xml, BootFX.Common.Xml.WriteXmlContext context) { base.WriteXml(xml, context); // add... xml.WriteElementString("GenerateParentAccessMethods", this.GenerateParentAccessMethods.ToString()); xml.WriteElementString("GenerateDtoField", this.GenerateDtoField.ToString()); xml.WriteElementString("JsonName", _jsonName); }
protected override void WriteXml(System.Xml.XmlWriter xml, BootFX.Common.Xml.WriteXmlContext context) { base.WriteXml(xml, context); // others... xml.WriteElementString("DbType", this.DbType.ToString()); xml.WriteElementString("Flags", this.Flags.ToString()); xml.WriteElementString("Length", this.Length.ToString()); xml.WriteElementString("EnumerationTypeName", this.EnumerationTypeName); xml.WriteElementString("Modifiers", this.Modifiers.ToString()); xml.WriteElementString("GenerateDtoField", this.GenerateDtoField.ToString()); xml.WriteElementString("JsonName", this.JsonName); }
/// <summary> /// Continues generating to the same context as another object. /// </summary> /// <param name="xml"></param> /// <param name="context"></param> public void ToXml(XmlWriter xml, WriteXmlContext context) { if (xml == null) { throw new ArgumentNullException("xml"); } if (context == null) { throw new ArgumentNullException("context"); } // defer... this.ToXml(xml, context.Encoding); }
/// <summary> /// Gets the XML representation of the object. /// </summary> /// <param name="xml"></param> /// <param name="elementName"></param> public virtual void ToXml(System.Xml.XmlWriter xml, string elementName, Encoding encoding) { if (xml == null) { throw new ArgumentNullException("xml"); } if (elementName == null) { throw new ArgumentNullException("elementName"); } if (elementName.Length == 0) { throw ExceptionHelper.CreateZeroLengthArgumentException("elementName"); } if (encoding == null) { throw new ArgumentNullException("encoding"); } // create a header element... xml.WriteStartElement(elementName); // attributes... Type type = this.GetType(); xml.WriteAttributeString("two47", "typeName", XmlHelper.ToXmlNamespaceUri, type.FullName); xml.WriteAttributeString("two47", "assembly", XmlHelper.ToXmlNamespaceUri, type.Assembly.FullName); xml.WriteAttributeString("two47", "strategy", XmlHelper.ToXmlNamespaceUri, ((object)XmlPersistenceStrategy.IToXml).ToString()); // write... WriteXmlContext context = new WriteXmlContext(encoding); this.WriteXml(xml, context); // footer... xml.WriteEndElement(); // elementName }
protected override void WriteXml(System.Xml.XmlWriter xml, BootFX.Common.Xml.WriteXmlContext context) { xml.WriteElementString("NativeName", this.NativeName); xml.WriteElementString("Name", this.Name); xml.WriteElementString("Generate", this.Generate.ToString()); }
/// <summary> /// Writes the XML. /// </summary> /// <param name="xml"></param> /// <remarks>At this point, a header element has been created.</remarks> protected abstract void WriteXml(XmlWriter xml, WriteXmlContext context);