SyndicationPerson.ElementExtensions プロパティ

定義

SyndicationPerson の要素拡張を取得します。

public:
 property System::ServiceModel::Syndication::SyndicationElementExtensionCollection ^ ElementExtensions { System::ServiceModel::Syndication::SyndicationElementExtensionCollection ^ get(); };
public System.ServiceModel.Syndication.SyndicationElementExtensionCollection ElementExtensions { get; }
member this.ElementExtensions : System.ServiceModel.Syndication.SyndicationElementExtensionCollection
Public ReadOnly Property ElementExtensions As SyndicationElementExtensionCollection

プロパティ値

SyndicationElementExtensionCollection

要素拡張が含まれる SyndicationElementExtensionCollection

要素拡張を SyndicationPerson インスタンスに追加する方法を次のコードに示します。

SyndicationPerson sp = new SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http://Jesper/Aaberg");
sp.ElementExtensions.Add("simpleString", "", "hello, world!");
Dim sp As New SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http://Jesper/Aaberg")
sp.ElementExtensions.Add("simpleString", "", "hello, world!")

ElementExtensions コレクションを Atom 1.0 にシリアル化する方法を次の XML に示します。

<author>
  <name>Kim Abercrombie</name>
  <uri>http://Kim/Abercrombie</uri>
  <email>Kim.Abercrombie@contoso.com</email>
  <customPersonElement xmlns="">person element text</customPersonElement>
</author>

ElementExtensions コレクションを RSS 2.0 にシリアル化する方法を次の XML に示します。

<a10:author>
  <a10:name>Kim Abercrombie</a10:name>
  <a10:uri>http://Kim/Abercrombie</a10:uri>
  <a10:email>Kim.Abercrombie@contoso.com</a10:email>
  <customPersonElement>person element text</customPersonElement>
</a10:author>

注釈

配信オブジェクト モデルを使用して、カスタム XML 要素を SyndicationPerson インスタンスに追加できます。 有効な XML 要素の名前空間がそこに含まれる名前空間と異なる限り、その XML 要素を追加できます。

Atom 1.0 にシリアル化する場合は、すべてのカスタム要素が <author> 要素または <contributor> 要素内の XML 要素として書き込まれます。

RSS 2.0 にシリアル化する場合は、すべてのカスタム要素が <managingEditor> 要素、<a10:contributor> 要素、または <a10:author> 要素内の XML 要素として書き込まれます。

適用対象