SyndicationPerson.AttributeExtensions Property

Definition

Gets the attribute extensions for the SyndicationPerson.

public System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName,string> AttributeExtensions { get; }

Property Value

A dictionary that contains a collection of attribute extensions.

Examples

The following code shows how to add an attribute extension to a SyndicationPerson instance.

SyndicationPerson sp = new SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http://Jesper/Aaberg");
sp.AttributeExtensions.Add(new XmlQualifiedName("myAttribute", ""), "someValue");

The following XML shows how the AttributeExtensions collection is serialized to Atom 1.0.

<author customAttribute="value">
  <name>Syed Abas</name>
  <uri>http://Syed/Abas</uri>
  <email>Syed.Abas@contoso.com</email>
</author>

The following XML shows how the AttributeExtensions collection is serialized to RSS 2.0.

<a10:author customAttribute="value">
  <a10:name>Syed Abas</a10:name>
  <a10:uri>http://Syed/Abas</a10:uri>
  <a10:email>Syed.Abas@contoso.com</a10:email>
</a10:author>

Remarks

The Syndication object model allows you to add custom attributes to a SyndicationPerson instance. You can add any valid XML attribute/value.

When serialized to Atom 1.0, any custom attribute/value is written as an attribute in the <author> or <contributor> elements. When serialized to RSS 2.0, any custom attribute/value is written as an attribute in the <managingEditor>, <a10:contributor>, or <a10:author> elements.

Applies to

Produk Versi
.NET 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided)
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)