Export (0) Print
Expand All

SyndicationLink Class

Represents a link within a syndication feed or item.

System.Object
  System.ServiceModel.Syndication.SyndicationLink

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

public class SyndicationLink

The SyndicationLink type exposes the following members.

  NameDescription
Public methodSyndicationLink()Creates a new instance of the SyndicationLink instance.
Protected methodSyndicationLink(SyndicationLink)Initializes a new instance of the SyndicationLink class with the specified instance.
Public methodSyndicationLink(Uri)Initializes a new instance of the SyndicationLink class with the specified Uri.
Public methodSyndicationLink(Uri, String, String, String, Int64)Initializes a new instance of the SyndicationLink class with the specified Uri, relation type, title, media type, and length.
Top

  NameDescription
Public propertyAttributeExtensionsGets the attribute extensions of the link.
Public propertyBaseUriGets and sets the base URI of the syndication link.
Public propertyElementExtensionsGets the element extensions for the SyndicationLink.
Public propertyLengthGets and sets the length of the linked resource in bytes.
Public propertyMediaTypeGets and sets the media type of the linked resource.
Public propertyRelationshipTypeGets and sets the relationship type of the linked resource.
Public propertyTitleGets and sets the title of the linked resource.
Public propertyUriGets and sets the URI for the linked resource.
Top

  NameDescription
Public methodCloneCreates a copy of the current SyndicationLink instance.
Public methodStatic memberCreateAlternateLink(Uri)Creates a new SyndicationLink object with the specified Uri.
Public methodStatic memberCreateAlternateLink(Uri, String)Creates a new SyndicationLink object with the specified Uri and media type.
Public methodStatic memberCreateMediaEnclosureLinkCreates a media enclosure link with the specified URI, media type, and length.
Public methodStatic memberCreateSelfLink(Uri)Creates a new SyndicationLink with the specified URI and relationship type set to self.
Public methodStatic memberCreateSelfLink(Uri, String)Creates a new SyndicationLink with the specified URI, media type, and relationship type set to self.
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 methodGetAbsoluteUriGets the absolute URI for the SyndicationLink.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Protected methodTryParseAttributeAttempts to parse an attribute extension.
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 specified syndication version.
Top

SyndicationLink can be added to a SyndicationFeed or SyndicationItem. When serialized to Atom 1.0 a SyndicationLink is written out as a <link> element, with the SyndicationLink properties written out as attributes of the <link> element. When serialized to RSS 2.0, the first SyndicationLink with a relationship value of ‘alternate’ is written out as a <link> element. Any additional links are written out as a <a10:link> elements.

The following example shows how to use the SyndicationLink class.

SyndicationFeed feed = new SyndicationFeed("Feed Title", "Feed Description", new Uri("http://Feed/Alternate/Link"), "FeedID", DateTime.Now);

SyndicationLink link = new SyndicationLink(new Uri("http://server/link"), "alternate", "Link Title", "text/html", 1000);
feed.Links.Add(link);

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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.
Show:
© 2014 Microsoft