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

 

Creates a new instance of the SyndicationFeed class.

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

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

Parameters

title
Type: System.String

The syndication feed title.

description
Type: System.String

The syndication feed description.

feedAlternateLink
Type: System.Uri

The alternate URI for the syndication feed.

id
Type: System.String

The ID of the syndication feed.

lastUpdatedTime
Type: System.DateTimeOffset

The DateTimeOffset that contains the last time the syndication feed was updated.

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

A collection of SyndicationItem objects.

The following code shows 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("Feed Title", "Feed Description", new Uri("http://Feed/Alternate/Link"), "FeedID", DateTime.Now, items);

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