/// <summary> /// Saves the current <see cref="BlogMLComment"/> 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("comment", BlogMLUtility.BlogMLNamespace); BlogMLUtility.WriteCommonObjectAttributes(this, writer); writer.WriteAttributeString("user-name", this.UserName); if (!String.IsNullOrEmpty(this.UserEmailAddress)) { writer.WriteAttributeString("user-email", this.UserEmailAddress); } if (this.UserUrl != null) { writer.WriteAttributeString("user-url", this.UserUrl.ToString()); } BlogMLUtility.WriteCommonObjectElements(this, writer); this.Content.WriteTo(writer, "content"); //------------------------------------------------------------ // Write the syndication extensions of the current instance //------------------------------------------------------------ SyndicationExtensionAdapter.WriteExtensionsTo(this.Extensions, writer); writer.WriteEndElement(); }
/// <summary> /// Saves the current <see cref="BlogMLCategory"/> 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("category", BlogMLUtility.BlogMLNamespace); BlogMLUtility.WriteCommonObjectAttributes(this, writer); if (!String.IsNullOrEmpty(this.ParentId)) { writer.WriteAttributeString("parentref", this.ParentId); } if (!String.IsNullOrEmpty(this.Description)) { writer.WriteAttributeString("description", this.Description); } BlogMLUtility.WriteCommonObjectElements(this, writer); //------------------------------------------------------------ // Write the syndication extensions of the current instance //------------------------------------------------------------ SyndicationExtensionAdapter.WriteExtensionsTo(this.Extensions, writer); writer.WriteEndElement(); }
/// <summary> /// Saves the current <see cref="BlogMLTrackback"/> 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("trackback", BlogMLUtility.BlogMLNamespace); BlogMLUtility.WriteCommonObjectAttributes(this, writer); writer.WriteAttributeString("url", this.Url != null ? this.Url.ToString() : String.Empty); BlogMLUtility.WriteCommonObjectElements(this, writer); SyndicationExtensionAdapter.WriteExtensionsTo(this.Extensions, writer); writer.WriteEndElement(); }
/// <summary> /// Saves the current <see cref="BlogMLAuthor"/> 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("author", BlogMLUtility.BlogMLNamespace); BlogMLUtility.WriteCommonObjectAttributes(this, writer); if (!String.IsNullOrEmpty(this.EmailAddress)) { writer.WriteAttributeString("email", this.EmailAddress); } BlogMLUtility.WriteCommonObjectElements(this, writer); SyndicationExtensionAdapter.WriteExtensionsTo(this.Extensions, writer); writer.WriteEndElement(); }
/// <summary> /// Saves the current <see cref="BlogMLCategory"/> 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("category", BlogMLUtility.BlogMLNamespace); BlogMLUtility.WriteCommonObjectAttributes(this, writer); if (!String.IsNullOrEmpty(this.ParentId)) { writer.WriteAttributeString("parentref", this.ParentId); } if (!String.IsNullOrEmpty(this.Description)) { writer.WriteAttributeString("description", this.Description); } BlogMLUtility.WriteCommonObjectElements(this, writer); SyndicationExtensionAdapter.WriteExtensionsTo(this.Extensions, writer); writer.WriteEndElement(); }
/// <summary> /// Saves the current <see cref="BlogMLTrackback"/> 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("trackback", BlogMLUtility.BlogMLNamespace); BlogMLUtility.WriteCommonObjectAttributes(this, writer); writer.WriteAttributeString("url", this.Url != null ? this.Url.ToString() : String.Empty); BlogMLUtility.WriteCommonObjectElements(this, writer); //------------------------------------------------------------ // Write the syndication extensions of the current instance //------------------------------------------------------------ SyndicationExtensionAdapter.WriteExtensionsTo(this.Extensions, writer); writer.WriteEndElement(); }
/// <summary> /// Saves the current <see cref="BlogMLComment"/> 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("comment", BlogMLUtility.BlogMLNamespace); BlogMLUtility.WriteCommonObjectAttributes(this, writer); writer.WriteAttributeString("user-name", this.UserName); if (!String.IsNullOrEmpty(this.UserEmailAddress)) { writer.WriteAttributeString("user-email", this.UserEmailAddress); } if (this.UserUrl != null) { writer.WriteAttributeString("user-url", this.UserUrl.ToString()); } BlogMLUtility.WriteCommonObjectElements(this, writer); this.Content.WriteTo(writer, "content"); SyndicationExtensionAdapter.WriteExtensionsTo(this.Extensions, writer); writer.WriteEndElement(); }