SyndicationItem.Content Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the content of the syndication item.
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
Property Value
A SyndicationContent instance that contains the content of the syndication item.
Examples
The following code shows how to add content to a 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")
The following XML shows how the Content property is serialized for Atom 1.0.
TextSyndicationContent is serialized as shown in the following example.
<content type="text">This is some content</content>
UrlSyndicationContent is serialized as shown in the following example.
<content type="text/html" src="http://myurl/" />
XmlSyndicationContent is serialized as shown in the following example.
<content type="MyXMLType">
<mg:MyElement xmlns:mg="http://migree/elements">This is some text</mg:MyElement>
</content>
The following XML shows how the Content property is serialized for RSS 2.0.
TextSyndicationContent is serialized as shown in the following example.
<description>This is some content</description>
UrlSyndicationContent is serialized as shown in the following example.
<a10:content type="text/html" src="http://myurl/" />
XmlSyndicationContent is serialized as shown in the following example.
<a10:content type="MyXMLType">
<mg:MyElement xmlns:mg="http://migree/elements">This is some text</mg:MyElement>
</a10:content>
Remarks
SyndicationContent is a base class for all syndication content types. The .NET Framework 3.5 defines the following syndication content types:
You can assign this property to any of these content types (or possibly a user-defined type derived from SyndicationContent).
For Atom 1.0, the Content property is serialized to a <content>
element.
For RSS 2.0, the Content property is serialized to a <description>
element for TextSyndicationContent, a <a10:content>
element for UrlSyndicationContent and XmlSyndicationContent.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기