Breyta

Deila með


SyndicationPerson.AttributeExtensions Property

Definition

Gets the attribute extensions for the SyndicationPerson.

public:
 property System::Collections::Generic::Dictionary<System::Xml::XmlQualifiedName ^, System::String ^> ^ AttributeExtensions { System::Collections::Generic::Dictionary<System::Xml::XmlQualifiedName ^, System::String ^> ^ get(); };
public System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName,string> AttributeExtensions { get; }
member this.AttributeExtensions : System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, string>
Public ReadOnly Property AttributeExtensions As Dictionary(Of XmlQualifiedName, String)

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");
Dim sp As 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