SyndicationLink 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
代表聯播資訊流或項目中的連結。
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 可以加入 SyndicationFeed 或 SyndicationItem。 當序列化成 Atom 1.0 時,a SyndicationLink 會被寫成一個 <link> 元素,屬性 SyndicationLink 則寫成該 <link> 元素的屬性。 當序列化至 RSS 2.0 時,第一個 SyndicationLink 關係值為「alternate」的符號會被寫成元素 <link> 。 任何額外的連結都會以 <a10:link> 元素形式列出。
建構函式
| 名稱 | Description |
|---|---|
| SyndicationLink() |
建立該 SyndicationLink 實例的新實例。 |
| SyndicationLink(SyndicationLink) |
初始化該類別的新實例 SyndicationLink ,並使用指定的實例。 |
| SyndicationLink(Uri, String, String, String, Int64) |
初始化一個新的類別實例 SyndicationLink ,包含指定的 Uri、關聯型態、標題、媒體型態及長度。 |
| SyndicationLink(Uri) |
使用指定的 SyndicationLink,初始化 Uri 類別的新實例。 |
屬性
| 名稱 | Description |
|---|---|
| AttributeExtensions |
取得連結的屬性延伸。 |
| BaseUri |
取得或設定聯播連結的基礎 URI。 |
| ElementExtensions |
取得 的 SyndicationLink元素擴展。 |
| Length |
取得或設定連結資源的長度(以位元組為單位)。 |
| MediaType |
取得或設定連結資源的媒體類型。 |
| RelationshipType |
取得或設定連結資源的關係類型。 |
| Title |
取得或設定連結資源的標題。 |
| Uri |
取得或設定連結資源的 URI。 |
方法
| 名稱 | Description |
|---|---|
| Clone() |
建立目前 SyndicationLink 實例的副本。 |
| CreateAlternateLink(Uri, String) |
建立一個符合指定SyndicationLink及媒體類型的新Uri物件。 |
| CreateAlternateLink(Uri) |
建立 SyndicationLink 一個新的物件,包含指定的 Uri。 |
| CreateMediaEnclosureLink(Uri, String, Int64) |
建立具有指定 URI、媒體類型與長度的媒體機箱連結。 |
| CreateSelfLink(Uri, String) |
建立 SyndicationLink 一個新的檔案,將指定的 URI、媒體類型及關係類型設定為 |
| CreateSelfLink(Uri) |
建立 SyndicationLink 一個新的,並設定指定的 URI 及關係類型為 |
| Equals(Object) |
判斷指定的物件是否等於目前的物件。 (繼承來源 Object) |
| GetAbsoluteUri() |
取得絕對的 URI 值。SyndicationLink |
| GetHashCode() |
做為預設哈希函式。 (繼承來源 Object) |
| GetType() |
取得目前實例的 Type。 (繼承來源 Object) |
| MemberwiseClone() |
建立目前 Object的淺層複本。 (繼承來源 Object) |
| ToString() |
傳回表示目前 物件的字串。 (繼承來源 Object) |
| TryParseAttribute(String, String, String, String) |
嘗試解析屬性擴充。 |
| TryParseElement(XmlReader, String) |
嘗試解析元素擴充。 |
| WriteAttributeExtensions(XmlWriter, String) |
使用指定的 syndication 版本,將屬性 XmlWriter 擴充寫入指定的。 |
| WriteElementExtensions(XmlWriter, String) |
使用指定的聯播版本將元素的擴展寫入指定 XmlWriter 內容。 |