/// <summary> /// Saves the current <see cref="RssCloud"/> to the specified <see cref="XmlWriter"/>. /// </summary> /// <param name="writer">The <see cref="XmlWriter"/> to which you want to save.</param> /// <exception cref="ArgumentNullException">The <paramref name="writer"/> is a null reference (Nothing in Visual Basic).</exception> public void WriteTo(XmlWriter writer) { //------------------------------------------------------------ // Validate parameter //------------------------------------------------------------ Guard.ArgumentNotNull(writer, "writer"); //------------------------------------------------------------ // Write XML representation of the current instance //------------------------------------------------------------ writer.WriteStartElement("cloud"); writer.WriteAttributeString("domain", this.Domain); writer.WriteAttributeString("path", this.Path); writer.WriteAttributeString("port", this.Port.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); writer.WriteAttributeString("protocol", RssCloud.CloudProtocolAsString(this.Protocol)); writer.WriteAttributeString("registerProcedure", this.RegisterProcedure); //------------------------------------------------------------ // Write the syndication extensions of the current instance //------------------------------------------------------------ SyndicationExtensionAdapter.WriteExtensionsTo(this.Extensions, writer); writer.WriteEndElement(); }
/// <summary> /// Saves the current <see cref="RssCloud"/> to the specified <see cref="XmlWriter"/>. /// </summary> /// <param name="writer">The <see cref="XmlWriter"/> to which you want to save.</param> /// <exception cref="ArgumentNullException">The <paramref name="writer"/> is a null reference (Nothing in Visual Basic).</exception> public void WriteTo(XmlWriter writer) { Guard.ArgumentNotNull(writer, "writer"); writer.WriteStartElement("cloud"); writer.WriteAttributeString("domain", this.Domain); writer.WriteAttributeString("path", this.Path); writer.WriteAttributeString("port", this.Port.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); writer.WriteAttributeString("protocol", RssCloud.CloudProtocolAsString(this.Protocol)); writer.WriteAttributeString("registerProcedure", this.RegisterProcedure); SyndicationExtensionAdapter.WriteExtensionsTo(this.Extensions, writer); writer.WriteEndElement(); }