Condividi tramite


SyndicationPerson.AttributeExtensions Proprietà

Definizione

Ottiene le estensioni dell'attributo per l'oggetto 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)

Valore della proprietà

Dizionario che contiene una raccolta di estensioni degli attributi.

Esempio

Nel codice seguente viene illustrato come aggiungere un'estensione dell'attributo a un'istanza SyndicationPerson di .

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")

Il codice XML seguente illustra come la AttributeExtensions raccolta viene serializzata in Atom 1.0.

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

Nel codice XML seguente viene illustrato come la AttributeExtensions raccolta viene serializzata in 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>

Commenti

Il modello a oggetti di diffusione consente di aggiungere attributi personalizzati a un'istanza SyndicationPerson di . È possibile aggiungere qualsiasi attributo/valore XML valido.

Se serializzato in Atom 1.0, qualsiasi attributo/valore personalizzato viene scritto come attributo negli <author> elementi o <contributor> . Se serializzato in RSS 2.0, qualsiasi attributo/valore personalizzato viene scritto come attributo negli <managingEditor>elementi , <a10:contributor>o <a10:author> .

Si applica a