SyndicationFeed.Items Eigenschaft

Definition

Ruft eine Sammlung der Feed-Elemente im Feed ab.

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)

Eigenschaftswert

IEnumerable<SyndicationItem>

Eine Auflistung von SyndicationItem-Objekten.

Beispiele

Im folgenden Code wird gezeigt, wie die Items-Auflistung einer SyndicationFeed-Instanz festgelegt wird.

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

Das folgende XML-Beispiel zeigt die Serialisierung der Items-Sammlung zu 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>

Das folgende XML-Beispiel zeigt die Serialisierung der Items-Sammlung zu RSS 2.0.

<item>
  <guid isPermaLink="false">ItemID</guid>
  <link>http://contoso/items</link>
  <title>Elementtitel</title>
  <description>Einige Textinhalte</description>
  <a10:updated>2007-04-13T17:29:38Z</a10:updated>
</item>

Hinweise

Wenn sie in Atom 1.0 serialisiert werden, wird die Items Auflistung in <entry> Elemente geschrieben.

Wenn sie in Atom 1.0 serialisiert werden, wird die Items Auflistung in <item> Elemente geschrieben.

Gilt für