SyndicationFeed.AttributeExtensions 屬性

定義

取得屬性擴充的集合。

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)

屬性值

Dictionary<XmlQualifiedName,String>

字典,其中包含屬性延伸的集合。

範例

下列程式碼會示範如何將屬性延伸加入至新聞訂閱摘要。

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

下列 XML 會說明如何將屬性延伸序列化為 Atom 1.0。

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

下列 XML 會說明如何將屬性延伸序列化為 RSS 2.0。

<channel CustomAttribute="Value">

備註

屬性延伸是指 Atom 1.0 或 RSS 2.0 規格中未指定的有效 XML 屬性。 當序列化為 Atom 1.0 時,集合中的每個自訂屬性都會寫入 元素 <atom> 。 序列化為 RSS 2.0 時,每個自訂屬性都會寫入元素 <channel> 。 如需新增屬性延伸模組的範例,請參閱 鬆散類型延伸模組 範例。

適用於