Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

SyndicationItem Class

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

System.Object
  System.ServiceModel.Syndication.SyndicationItem

Namespace:  System.ServiceModel.Syndication
Assembly:  System.ServiceModel (in System.ServiceModel.dll)
public class SyndicationItem

The SyndicationItem type exposes the following members.

  NameDescription
Public methodSyndicationItem()Initializes a new instance of the SyndicationItem class.
Protected methodSyndicationItem(SyndicationItem)Initializes a new instance of the SyndicationItem class with the specified SyndicationItem instance.
Public methodSyndicationItem(String, String, Uri)Initializes a new instance of the SyndicationItem class with the specified title, content, and link.
Public methodSyndicationItem(String, SyndicationContent, Uri, String, DateTimeOffset)Initializes a new instance of the SyndicationItem class.
Public methodSyndicationItem(String, String, Uri, String, DateTimeOffset)Initializes a new instance of the SyndicationItem class.
Top
  NameDescription
Public propertyAttributeExtensionsGets the attribute extensions for the syndication item.
Public propertyAuthorsGets the authors of the syndication item.
Public propertyBaseUriGets and sets the base Uniform Resource Identifier (URI) for the SyndicationItem instance.
Public propertyCategoriesGets the syndication categories for the syndication item.
Public propertyContentGets and sets the content of the syndication item.
Public propertyContributorsGets the contributors of the syndication item.
Public propertyCopyrightGets and sets the copyright information for the syndication item.
Public propertyElementExtensionsGets the element extensions contained in the syndication item.
Public propertyIdGets and sets the ID of the syndication item.
Public propertyLastUpdatedTimeGets and sets the last updated time for the syndication item.
Public propertyLinksGets the links contained in the syndication item.
Public propertyPublishDateGets and sets the publish date for the syndication item.
Public propertySourceFeedGets and sets the source feed of the syndication item.
Public propertySummaryGets and sets the summary of the syndication item.
Public propertyTitleGets and sets the title of the syndication item.
Top
  NameDescription
Public methodAddPermalinkAdds a permalink to the SyndicationItem.
Public methodCloneCreates a copy of the SyndicationItem instance.
Protected methodCreateCategoryCreates a new category.
Protected methodCreateLinkCreates a new SyndicationLink instance.
Protected methodCreatePersonCreates a new person.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetAtom10FormatterGets an Atom10FeedFormatter instance.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetRss20Formatter()Gets an Rss20FeedFormatter instance.
Public methodGetRss20Formatter(Boolean)Gets an Rss20FeedFormatter instance.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodStatic memberLoad(XmlReader)Loads a SyndicationItem instance from the specified XmlReader.
Public methodStatic memberLoad<TSyndicationItem>(XmlReader)Loads a SyndicationItem derived object from the specified XmlReader.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSaveAsAtom10Write the syndication item to the specified XmlWriter in Atom 1.0 format.
Public methodSaveAsRss20Write the syndication item to the specified XmlWriter in RSS 2.0 format.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Protected methodTryParseAttributeAttempts to parse an attribute extension.
Protected methodTryParseContentAttempts to parse content.
Protected methodTryParseElementAttempts to parse an element extension.
Protected methodWriteAttributeExtensionsWrites the attribute extensions to the specified XmlWriter using the specified syndication version.
Protected methodWriteElementExtensionsWrites the element extensions to the specified XmlWriter using the specific syndication version.
Top

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;

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.