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)

プロパティ値

Dictionary<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>これは自分のアイテムの概要です</description>
  <a10:content type="text">This is some content</a10:content>
</item>

注釈

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

適用対象