SyndicationItem.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)

プロパティ値

属性拡張のコレクションを含むディクショナリ。

次のコードは、シンジケーション フィードに属性拡張機能を追加する方法を示しています。

SyndicationItem item = new SyndicationItem();
item.AttributeExtensions.Add(new XmlQualifiedName("myAttribute", ""), "someValue");
Dim item As New SyndicationItem()
item.AttributeExtensions.Add(New XmlQualifiedName("myAttribute", ""), "someValue")

次の XML コードは、SyndicationItem というカスタム属性を持つitemAttrib インスタンスの Atom 1.0 シリアル化を示しています。

<link rel="alternate" href="http://someserver/MyItem" />
<content type="text">This is some content</content>

次のコードは、RSS 2.0 としてシリアル化されたのと同じ SyndicationItem インスタンスを示しています。

<item p4:itemAttrib="ItemAttribValue" xmlns:p4="http://FeedServer/tags">
  <link>http://someserver/MyItem</link>
  <link>http://alternate/Link</link>
  <source>MyFeed</source>
  <link>http://someserver/MyItem</link>
  <author>jesper@contoso.com</author>
  <description>this is a summary for my item</description>
  <a10:content type="text">This is some content</a10:content>
</item>

注釈

配信オブジェクト モデルを使用すると、 SyndicationItem インスタンスにカスタム属性を追加できます。 Atom 1.0 に対してシリアル化すると、カスタム属性が <entry> 要素に書き込まれます。 RSS 2.0 でシリアル化すると、カスタム属性が <item> 要素に書き込まれます。 属性拡張機能を追加する方法を示す完全な例については、 Loosely-Typed 拡張機能 のサンプルを参照してください。

適用対象