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)

属性值

包含属性扩展集合的字典。

示例

以下代码演示如何向联合源添加属性扩展。

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> 元素。 有关添加属性扩展的示例,请参阅 Loosely-Typed 扩展 示例。

适用于