SyndicationFeed Constructor (String, String, Uri, IEnumerable<SyndicationItem>)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Initializes a new instance of the SyndicationFeed class with the specified title, description, URI, and collection of SyndicationItem objects.

Namespace:   System.ServiceModel.Syndication
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public SyndicationFeed(
	string title,
	string description,
	Uri feedAlternateLink,
	IEnumerable<SyndicationItem> items
)

Parameters

title
Type: System.String

The title of the feed.

description
Type: System.String

The description of the feed.

feedAlternateLink
Type: System.Uri

The URI for the feed.

items
Type: System.Collections.Generic.IEnumerable<SyndicationItem>

A collection of SyndicationItem objects.

The following example demonstrates how to call this constructor.

List<SyndicationItem> items = new List<SyndicationItem>();
SyndicationItem item1 = new SyndicationItem();
item1.Title = new TextSyndicationContent("Item 1");
item1.Summary = new TextSyndicationContent("This is Item 1's summary");
item1.Authors.Add(new SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http://contoso/jesper"));
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.Summary = new TextSyndicationContent("This is Item 2's summary");
item2.Authors.Add(new SyndicationPerson("lene@contoso.com", "Lene Aaling", "http://contoso/lene"));
item2.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 2");
items.Add(item2);

SyndicationFeed feed = new SyndicationFeed("My Data Feed", "This is a sample feed", new Uri("http://localhost/MyDataService"), items);

.NET Framework
Available since 3.5
Silverlight
Available since 2.0
Return to top
Show: