internal static protected void WriteElementExtensions(XmlWriter writer, SyndicationLink link, string version)
 {
     if (link == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("link");
     }
     link.WriteElementExtensions(writer, version);
 }
Beispiel #2
0
 internal static protected void WriteElementExtensions(XmlWriter writer, SyndicationLink link, string version)
 {
     if (link == null)
     {
         throw new ArgumentNullException(nameof(link));
     }
     link.WriteElementExtensions(writer, version);
 }
		protected internal void WriteElementExtensions (XmlWriter writer, SyndicationLink link, string version)
		{
			if (link == null)
				throw new ArgumentNullException ("link");
			link.WriteElementExtensions (writer, version);
		}
 internal void WriteLink(XmlWriter writer, SyndicationLink link, Uri baseUri)
 {
     writer.WriteStartElement(Atom10Constants.LinkTag, Atom10Constants.Atom10Namespace);
     Uri baseUriToWrite = FeedUtils.GetBaseUriToWrite(baseUri, link.BaseUri);
     if (baseUriToWrite != null)
     {
         writer.WriteAttributeString("xml", "base", XmlNs, FeedUtils.GetUriString(baseUriToWrite));
     }
     link.WriteAttributeExtensions(writer, SyndicationVersions.Atom10);
     if (!string.IsNullOrEmpty(link.RelationshipType) && !link.AttributeExtensions.ContainsKey(Atom10Relative))
     {
         writer.WriteAttributeString(Atom10Constants.RelativeTag, link.RelationshipType);
     }
     if (!string.IsNullOrEmpty(link.MediaType) && !link.AttributeExtensions.ContainsKey(Atom10Type))
     {
         writer.WriteAttributeString(Atom10Constants.TypeTag, link.MediaType);
     }
     if (!string.IsNullOrEmpty(link.Title) && !link.AttributeExtensions.ContainsKey(Atom10Title))
     {
         writer.WriteAttributeString(Atom10Constants.TitleTag, link.Title);
     }
     if (link.Length != 0 && !link.AttributeExtensions.ContainsKey(Atom10Length))
     {
         writer.WriteAttributeString(Atom10Constants.LengthTag, Convert.ToString(link.Length, CultureInfo.InvariantCulture));
     }
     if (!link.AttributeExtensions.ContainsKey(Atom10Href))
     {
         writer.WriteAttributeString(Atom10Constants.HrefTag, FeedUtils.GetUriString(link.Uri));
     }
     link.WriteElementExtensions(writer, SyndicationVersions.Atom10);
     writer.WriteEndElement();
 }
 internal void WriteLink(XmlWriter writer, SyndicationLink link, Uri baseUri)
 {
     writer.WriteStartElement("link", "http://www.w3.org/2005/Atom");
     Uri baseUriToWrite = FeedUtils.GetBaseUriToWrite(baseUri, link.BaseUri);
     if (baseUriToWrite != null)
     {
         writer.WriteAttributeString("xml", "base", "http://www.w3.org/XML/1998/namespace", FeedUtils.GetUriString(baseUriToWrite));
     }
     link.WriteAttributeExtensions(writer, "Atom10");
     if (!string.IsNullOrEmpty(link.RelationshipType) && !link.AttributeExtensions.ContainsKey(Atom10Relative))
     {
         writer.WriteAttributeString("rel", link.RelationshipType);
     }
     if (!string.IsNullOrEmpty(link.MediaType) && !link.AttributeExtensions.ContainsKey(Atom10Type))
     {
         writer.WriteAttributeString("type", link.MediaType);
     }
     if (!string.IsNullOrEmpty(link.Title) && !link.AttributeExtensions.ContainsKey(Atom10Title))
     {
         writer.WriteAttributeString("title", link.Title);
     }
     if ((link.Length != 0L) && !link.AttributeExtensions.ContainsKey(Atom10Length))
     {
         writer.WriteAttributeString("length", Convert.ToString(link.Length, CultureInfo.InvariantCulture));
     }
     if (!link.AttributeExtensions.ContainsKey(Atom10Href))
     {
         writer.WriteAttributeString("href", FeedUtils.GetUriString(link.Uri));
     }
     link.WriteElementExtensions(writer, "Atom10");
     writer.WriteEndElement();
 }