Export (0) Print
Expand All

SyndicationItem Class

Represents a feed item, for example an RSS <item> or an Atom <entry>.

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

public class SyndicationItem

When serialized to Atom 1.0, a SyndicationItem instance is written to an <entry> element. The following table shows how each property defined for SyndicationItem is serialized for Atom 1.0.

SyndicationItem property

Serialized form

AttributeExtensions

Attribute in the <entry> element.

Authors

An <author> element for each author in the collection.

Categories

A<category> element.

Content

A<content> element.

Contributors

A<contributor> element for each contributor in the collection.

Copyright

A<rights> element.

ElementExtensions

Element in the <entry> element.

Id

An <id> element.

LastUpdatedTime

An <updated> element.

Links

A <link> element for each link in the collection.

PublishDate

A <published> element.

SourceFeed

A <source> element.

Summary

A <summary> element.

Title

A <title> element.

When serialized to RSS 2.0, a SyndicationItem instance is written to an <item> element. The following table shows how each property defined for SyndicationItem is serialized for RSS 2.0.

SyndicationItem property

Serialized form

AttributeExtensions

Attribute in the <item> element.

Authors

A <managingEditor> if only one SyndicationPerson is in the Authors collection; otherwise, the <a10:author> element for each author in the collection.

Categories

A <category> element.

Content

An <a10:content> element.

Contributors

An <a10:contributor> element for each SyndicationPerson in the Contributors collection.

Copyright

A <copyright> element.

ElementExtensions

Element in the <item> element.

Id

An <a10:id> element.

LastUpdatedTime

An <a10:updated> element.

Links

A <link> element for each SyndicationLink in the Links collection.

PublishDate

A <pubDate> element.

SourceFeed

A <source> element.

Summary

A <description> element.

Title

A <title> element.

The following code shows how to use the SyndicationItem class.

SyndicationItem item = new SyndicationItem("My Item", "This is some content", new Uri("http://SomeServer/MyItem"), "Item ID", DateTime.Now);
item.Authors.Add(new SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http://contoso/jesper"));
item.Categories.Add(new SyndicationCategory("Category One"));
item.Contributors.Add(new SyndicationPerson("lene@contoso.com", "Lene Aaling", "http://contoso/lene"));
item.Copyright = new TextSyndicationContent("Copyright 2007");
item.Links.Add(new SyndicationLink(new Uri("http://OtherServer/Item"), "alternate", "Alternate Link", "text/html", 1000));
item.PublishDate = new DateTime(2007, 2, 23);
item.Summary = new TextSyndicationContent("this is a summary for my item");
XmlQualifiedName xqName = new XmlQualifiedName("itemAttrib", "http://FeedServer/tags");
item.AttributeExtensions.Add(xqName, "ItemAttribValue");

SyndicationFeed feed = new SyndicationFeed();
Collection<SyndicationItem> items = new Collection<SyndicationItem>();
items.Add(item);
feed.Items = items;

System.Object
  System.ServiceModel.Syndication.SyndicationItem

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5

Community Additions

ADD
Show:
© 2014 Microsoft