SyndicationFeed.AttributeExtensions Egenskap

Definition

Hämtar en samling attributtillägg.

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)

Egenskapsvärde

En ordlista som innehåller en samling attributtillägg.

Exempel

Följande kod visar hur du lägger till ett attributtillägg i en syndikeringsfeed.

SyndicationFeed feed = new SyndicationFeed();

//Attribute extensions are stored in a dictionary indexed by XmlQualifiedName
feed.AttributeExtensions.Add(new XmlQualifiedName("myAttribute", ""), "someValue");
Dim feed As New SyndicationFeed()

'Attribute extensions are stored in a dictionary indexed by XmlQualifiedName
feed.AttributeExtensions.Add(New XmlQualifiedName("myAttribute", ""), "someValue")

Följande XML visar hur ett attributtillägg serialiseras till Atom 1.0.

<feed xml:lang="en-us" CustomAttribute="Value" xmlns="http://www.w3.org/2005/Atom">

Följande XML visar hur ett attributtillägg serialiseras till RSS 2.0.

<channel CustomAttribute="Value">

Kommentarer

Ett attributtillägg är ett giltigt XML-attribut som inte anges i varken Atom 1.0- eller RSS 2.0-specifikationerna. När de serialiseras till Atom 1.0 skrivs varje anpassat attribut i samlingen till elementet <atom> . När det serialiseras till RSS 2.0 skrivs varje anpassat attribut till elementet <channel> . Ett exempel på hur du lägger till ett attributtillägg finns i exemplet Loosely-Typed Tillägg .

Gäller för