SyndicationFeed.Items 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 a collection of the feed items contained in the feed.
public:
property System::Collections::Generic::IEnumerable<System::ServiceModel::Syndication::SyndicationItem ^> ^ Items { System::Collections::Generic::IEnumerable<System::ServiceModel::Syndication::SyndicationItem ^> ^ get(); void set(System::Collections::Generic::IEnumerable<System::ServiceModel::Syndication::SyndicationItem ^> ^ value); };
public System.Collections.Generic.IEnumerable<System.ServiceModel.Syndication.SyndicationItem> Items { get; set; }
member this.Items : seq<System.ServiceModel.Syndication.SyndicationItem> with get, set
Public Property Items As IEnumerable(Of SyndicationItem)
Property Value
A collection of SyndicationItem objects.
Examples
The following code shows how to set the Items collection of a SyndicationFeed instance.
List<SyndicationItem> items = new List<SyndicationItem>();
SyndicationItem item1 = new SyndicationItem();
item1.Title = new TextSyndicationContent("Item 1");
item1.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 1");
items.Add(item1);
SyndicationItem item2 = new SyndicationItem();
item2.Title = new TextSyndicationContent("Item 2");
item2.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 2");
items.Add(item2);
SyndicationFeed feed = new SyndicationFeed();
feed.Items = items;
Dim items = New List(Of SyndicationItem)()
Dim item1 = New SyndicationItem()
item1.Title = New TextSyndicationContent("Item 1")
item1.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 1")
items.Add(item1)
Dim item2 = New SyndicationItem()
item2.Title = New TextSyndicationContent("Item 2")
item2.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 2")
items.Add(item2)
Dim feed = New SyndicationFeed()
feed.Items = items
The following XML shows how the Items collection is serialized to Atom 1.0.
<entry>
<id>ItemID</id>
<title type="text">Item Title</title>
<updated>2007-04-13T17:29:38Z</updated>
<link rel="alternate" href="http://contoso/items" />
<content type="text">Some text content</content>
</entry>
The following XML shows how the Items collection is serialized to RSS 2.0.
<item>
<guid isPermaLink="false">ItemID</guid>
<link>http://contoso/items</link>
<title>Item Title</title>
<description>Some text content</description>
<a10:updated>2007-04-13T17:29:38Z</a10:updated>
</item>
Remarks
When serialized to Atom 1.0, the Items collection is written to <entry>
elements.
When serialized to Atom 1.0, the Items collection is written to <item>
elements.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기