SyndicationItem SyndicationItem SyndicationItem SyndicationItem Class

Definition

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

public ref class SyndicationItem
public class SyndicationItem
type SyndicationItem = class
Public Class SyndicationItem
Inheritance
SyndicationItemSyndicationItemSyndicationItemSyndicationItem

Examples

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;
Dim item As SyndicationItem = 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")
Dim xqName As XmlQualifiedName = New XmlQualifiedName("itemAttrib", "http:' FeedServer/tags")
item.AttributeExtensions.Add(xqName, "ItemAttribValue")

Dim feed As SyndicationFeed = New SyndicationFeed()
Dim items As Collection(Of SyndicationItem) = New Collection(Of SyndicationItem)()
items.Add(item)
feed.Items = items

Remarks

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.

Constructors

SyndicationItem() SyndicationItem() SyndicationItem() SyndicationItem()

Initializes a new instance of the SyndicationItem class.

SyndicationItem(String, String, Uri) SyndicationItem(String, String, Uri) SyndicationItem(String, String, Uri) SyndicationItem(String, String, Uri)

Initializes a new instance of the SyndicationItem class with the specified title, content, and link.

SyndicationItem(String, String, Uri, String, DateTimeOffset) SyndicationItem(String, String, Uri, String, DateTimeOffset) SyndicationItem(String, String, Uri, String, DateTimeOffset) SyndicationItem(String, String, Uri, String, DateTimeOffset)

Initializes a new instance of the SyndicationItem class.

SyndicationItem(String, SyndicationContent, Uri, String, DateTimeOffset) SyndicationItem(String, SyndicationContent, Uri, String, DateTimeOffset) SyndicationItem(String, SyndicationContent, Uri, String, DateTimeOffset) SyndicationItem(String, SyndicationContent, Uri, String, DateTimeOffset)

Initializes a new instance of the SyndicationItem class.

SyndicationItem(SyndicationItem) SyndicationItem(SyndicationItem) SyndicationItem(SyndicationItem) SyndicationItem(SyndicationItem)

Initializes a new instance of the SyndicationItem class with the specified SyndicationItem instance.

Properties

AttributeExtensions AttributeExtensions AttributeExtensions AttributeExtensions

Gets the attribute extensions for the syndication item.

Authors Authors Authors Authors

Gets the authors of the syndication item.

BaseUri BaseUri BaseUri BaseUri

Gets or sets the base Uniform Resource Identifier (URI) for the SyndicationItem instance.

Categories Categories Categories Categories

Gets the syndication categories for the syndication item.

Content Content Content Content

Gets or sets the content of the syndication item.

Contributors Contributors Contributors Contributors

Gets the contributors of the syndication item.

Copyright Copyright Copyright Copyright

Gets or sets the copyright information for the syndication item.

ElementExtensions ElementExtensions ElementExtensions ElementExtensions

Gets the element extensions contained in the syndication item.

Id Id Id Id

Gets or sets the ID of the syndication item.

LastUpdatedTime LastUpdatedTime LastUpdatedTime LastUpdatedTime

Gets or sets the last updated time for the syndication item.

Links Links Links Links

Gets the links contained in the syndication item.

PublishDate PublishDate PublishDate PublishDate

Gets or sets the publish date for the syndication item.

SourceFeed SourceFeed SourceFeed SourceFeed

Gets or sets the source feed of the syndication item.

Summary Summary Summary Summary

Gets or sets the summary of the syndication item.

Title Title Title Title

Gets or sets the title of the syndication item.

Methods

AddPermalink(Uri) AddPermalink(Uri) AddPermalink(Uri) AddPermalink(Uri)

Adds a permalink to the SyndicationItem.

Clone() Clone() Clone() Clone()

Creates a copy of the SyndicationItem instance.

CreateCategory() CreateCategory() CreateCategory() CreateCategory()

Creates a new category.

CreateLink() CreateLink() CreateLink() CreateLink()

Creates a new SyndicationLink instance.

CreatePerson() CreatePerson() CreatePerson() CreatePerson()

Creates a new person.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetAtom10Formatter() GetAtom10Formatter() GetAtom10Formatter() GetAtom10Formatter()

Gets an Atom10FeedFormatter instance.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetRss20Formatter() GetRss20Formatter() GetRss20Formatter() GetRss20Formatter()

Gets an Rss20FeedFormatter instance.

GetRss20Formatter(Boolean) GetRss20Formatter(Boolean) GetRss20Formatter(Boolean) GetRss20Formatter(Boolean)

Gets an Rss20FeedFormatter instance.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
Load(XmlReader) Load(XmlReader) Load(XmlReader) Load(XmlReader)

Loads a SyndicationItem instance from the specified XmlReader.

Load<TSyndicationItem>(XmlReader) Load<TSyndicationItem>(XmlReader) Load<TSyndicationItem>(XmlReader) Load<TSyndicationItem>(XmlReader)

Loads a SyndicationItem derived object from the specified XmlReader.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
SaveAsAtom10(XmlWriter) SaveAsAtom10(XmlWriter) SaveAsAtom10(XmlWriter) SaveAsAtom10(XmlWriter)

Write the syndication item to the specified XmlWriter in Atom 1.0 format.

SaveAsRss20(XmlWriter) SaveAsRss20(XmlWriter) SaveAsRss20(XmlWriter) SaveAsRss20(XmlWriter)

Write the syndication item to the specified XmlWriter in RSS 2.0 format.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
TryParseAttribute(String, String, String, String) TryParseAttribute(String, String, String, String) TryParseAttribute(String, String, String, String) TryParseAttribute(String, String, String, String)

Attempts to parse an attribute extension.

TryParseContent(XmlReader, String, String, SyndicationContent) TryParseContent(XmlReader, String, String, SyndicationContent) TryParseContent(XmlReader, String, String, SyndicationContent) TryParseContent(XmlReader, String, String, SyndicationContent)

Attempts to parse content.

TryParseElement(XmlReader, String) TryParseElement(XmlReader, String) TryParseElement(XmlReader, String) TryParseElement(XmlReader, String)

Attempts to parse an element extension.

WriteAttributeExtensions(XmlWriter, String) WriteAttributeExtensions(XmlWriter, String) WriteAttributeExtensions(XmlWriter, String) WriteAttributeExtensions(XmlWriter, String)

Writes the attribute extensions to the specified XmlWriter using the specified syndication version.

WriteElementExtensions(XmlWriter, String) WriteElementExtensions(XmlWriter, String) WriteElementExtensions(XmlWriter, String) WriteElementExtensions(XmlWriter, String)

Writes the element extensions to the specified XmlWriter using the specific syndication version.

Applies to