SyndicationLink 类

定义

表示联合源或项中的链接。

public ref class SyndicationLink
public class SyndicationLink
type SyndicationLink = class
Public Class SyndicationLink
继承
SyndicationLink

示例

下面的示例演示如何使用 SyndicationLink 类。

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);
Dim feed As SyndicationFeed = New SyndicationFeed("Feed Title", "Feed Description", New Uri("http://Feed/Alternate/Link"), "FeedID", DateTime.Now)

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

注解

SyndicationLink 可以添加到或 SyndicationFeedSyndicationItem. 序列化为 Atom 1.0 时,将 SyndicationLink 作为元素写出 <link>SyndicationLink 并将属性写出为元素的属性 <link> 。 序列化为 RSS 2.0 时,第一 SyndicationLink 个关系值为“alternate”的关系值将写出为元素 <link> 。 任何其他链接都以元素的形式 <a10:link> 写出。

构造函数

名称 说明
SyndicationLink()

创建实例的新实例 SyndicationLink

SyndicationLink(SyndicationLink)

使用指定的实例初始化 SyndicationLink 类的新实例。

SyndicationLink(Uri, String, String, String, Int64)

使用指定的SyndicationLink、关系类型、标题、媒体类型和长度初始化类的新实例Uri

SyndicationLink(Uri)

用指定的SyndicationLink值初始化类的新实例Uri

属性

名称 说明
AttributeExtensions

获取链接的属性扩展。

BaseUri

获取或设置联合链接的基 URI。

ElementExtensions

获取 . 的 SyndicationLink元素扩展。

Length

获取或设置链接资源的长度(以字节为单位)。

MediaType

获取或设置链接资源的媒体类型。

RelationshipType

获取或设置链接资源的关系类型。

Title

获取或设置链接资源的标题。

Uri

获取或设置链接资源的 URI。

方法

名称 说明
Clone()

创建当前 SyndicationLink 实例的副本。

CreateAlternateLink(Uri, String)

创建具有指定SyndicationLink类型和媒体类型的新Uri对象。

CreateAlternateLink(Uri)

使用指定的SyndicationLink对象创建一个新Uri对象。

CreateMediaEnclosureLink(Uri, String, Int64)

创建具有指定 URI、媒体类型和长度的媒体机箱链接。

CreateSelfLink(Uri, String)

使用指定的 URI、媒体类型和关系类型设置为 SyndicationLink 创建一个新self项。

CreateSelfLink(Uri)

使用指定的 URI 和关系类型设置为 SyndicationLink 创建新self项。

Equals(Object)

确定指定的对象是否等于当前对象。

(继承自 Object)
GetAbsoluteUri()

获取 . 的 SyndicationLink绝对 URI。

GetHashCode()

用作默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object的浅表副本。

(继承自 Object)
ToString()

返回一个表示当前对象的字符串。

(继承自 Object)
TryParseAttribute(String, String, String, String)

尝试分析属性扩展。

TryParseElement(XmlReader, String)

尝试分析元素扩展。

WriteAttributeExtensions(XmlWriter, String)

使用指定的联合版本将属性扩展写入指定的 XmlWriter 属性扩展。

WriteElementExtensions(XmlWriter, String)

使用指定的联合版本将元素扩展写入指定的 XmlWriter

适用于