SyndicationItem.Content プロパティ

定義

配信項目のコンテンツを取得または設定します。

public:
 property System::ServiceModel::Syndication::SyndicationContent ^ Content { System::ServiceModel::Syndication::SyndicationContent ^ get(); void set(System::ServiceModel::Syndication::SyndicationContent ^ value); };
public System.ServiceModel.Syndication.SyndicationContent Content { get; set; }
member this.Content : System.ServiceModel.Syndication.SyndicationContent with get, set
Public Property Content As SyndicationContent

プロパティ値

SyndicationContent

配信項目のコンテンツを含む SyndicationContent インスタンス。

次のコードは、コンテンツを SyndicationItem に追加する方法を示しています。

SyndicationItem item = new SyndicationItem("Item Title", "Item Content", new Uri("http://Item/Alternate/Link"));
item.Content = new TextSyndicationContent("This is the content of the syndication item");
Dim item As New SyndicationItem("Item Title", "Item Content", New Uri("http:' Item/Alternate/Link"))
item.Content = New TextSyndicationContent("This is the content of the syndication item")

次の XML は、Content プロパティが Atom 1.0 にシリアル化される方法を示しています。

TextSyndicationContent は、次の例のようにしてシリアル化します。

<content type="text">This is some content</content>  

UrlSyndicationContent は、次の例のようにしてシリアル化します。

<content type="text/html" src="http://myurl/" />  

XmlSyndicationContent は、次の例のようにしてシリアル化します。

<content type="MyXMLType">  
    <mg:MyElement xmlns:mg="http://migree/elements">This is some text</mg:MyElement>  
</content>  

次の XML は、Content プロパティが RSS 2.0 にシリアル化される方法を示しています。

TextSyndicationContent は、次の例のようにしてシリアル化します。

<description>This is some content</description>  

UrlSyndicationContent は、次の例のようにしてシリアル化します。

<a10:content type="text/html" src="http://myurl/" />  

XmlSyndicationContent は、次の例のようにしてシリアル化します。

<a10:content type="MyXMLType">  
    <mg:MyElement xmlns:mg="http://migree/elements">This is some text</mg:MyElement>  
</a10:content>  

注釈

SyndicationContent は、すべての配信コンテンツ タイプの基本クラスです。 .NET Framework 3.5 では、次の配信コンテンツ タイプが定義されています。

このプロパティを以下のコンテンツの種類 (または、から派生したユーザー定義型) のいずれかに割り当てることができます。

Atom 1.0 の場合、Content プロパティは <content> 要素にシリアル化されます。

RSS 2.0 の場合、Content プロパティは、<description>TextSyndicationContent 要素、および <a10:content>UrlSyndicationContentXmlSyndicationContent 要素にシリアル化されます。

適用対象