TextSyndicationContent 类
定义
表示预期要显示给最终用户的任何 SyndicationItem 内容。Represents any SyndicationItem content intended to be displayed to an end user.
public ref class TextSyndicationContent : System::ServiceModel::Syndication::SyndicationContent
public class TextSyndicationContent : System.ServiceModel.Syndication.SyndicationContent
type TextSyndicationContent = class
inherit SyndicationContent
Public Class TextSyndicationContent
Inherits SyndicationContent
- 继承
示例
下面的示例演示如何使用 TextSyndicationContent 类。The following example demonstrates how to use the TextSyndicationContent class.
SyndicationFeed feed = new SyndicationFeed("Feed Title", "Feed Description", new Uri("http://Feed/Alternate/Link"), "FeedID", DateTime.Now);
feed.Copyright = new TextSyndicationContent("Copyright 2007");
feed.Description = new TextSyndicationContent("This is a sample feed");
TextSyndicationContent textContent = new TextSyndicationContent("Some text content");
SyndicationItem item = new SyndicationItem("Item Title", textContent, new Uri("http://server/items"), "ItemID", DateTime.Now);
Dim feed As SyndicationFeed = New SyndicationFeed("Feed Title", "Feed Description", New Uri("http://Feed/Alternate/Link"), "FeedID", DateTime.Now)
feed.Copyright = New TextSyndicationContent("Copyright 2007")
feed.Description = New TextSyndicationContent("This is a sample feed")
Dim textContent As TextSyndicationContent = New TextSyndicationContent("Some text content")
Dim item As SyndicationItem = New SyndicationItem("Item Title", textContent, New Uri("http://server/items"), "ItemID", DateTime.Now)
注解
文本内容是 HTML(含转义标记)、XHTML(有效的 XML 且未转义)或纯文本。Text content is HTML (with escaped markup), XHTML (valid XML, and is not escaped), or plain text.
构造函数
| TextSyndicationContent(String) |
使用指定的文本初始化 TextSyndicationContent 的新实例。Initializes a new instance of the TextSyndicationContent with the specified text. |
| TextSyndicationContent(String, TextSyndicationContentKind) |
使用指定的文本和 TextSyndicationContent 初始化 TextSyndicationContentKind 的新实例。Initializes a new instance of the TextSyndicationContent with the specified text and TextSyndicationContentKind. |
| TextSyndicationContent(TextSyndicationContent) |
使用指定的 TextSyndicationContent 实例初始化 TextSyndicationContent 的新实例。Initializes a new instance of the TextSyndicationContent with the specified TextSyndicationContent instance. |
属性
| AttributeExtensions |
获取此内容的属性扩展。Gets the attribute extensions for this content. (继承自 SyndicationContent) |
| Text |
获取 TextSyndicationContent 的文本。Gets the text of the TextSyndicationContent. |
| Type |
获取 TextSyndicationContent 的内容类型。Gets the content type of the TextSyndicationContent. |
方法
| Clone() |
创建现有 SyndicationContent 实例的副本。Creates a copy of the existing SyndicationContent instance. |
| Equals(Object) |
确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object. (继承自 Object) |
| GetHashCode() |
作为默认哈希函数。Serves as the default hash function. (继承自 Object) |
| GetType() |
获取当前实例的 Type。Gets the Type of the current instance. (继承自 Object) |
| MemberwiseClone() |
创建当前 Object 的浅表副本。Creates a shallow copy of the current Object. (继承自 Object) |
| ToString() |
返回表示当前对象的字符串。Returns a string that represents the current object. (继承自 Object) |
| WriteContentsTo(XmlWriter) |
将 TextSyndicationContent 的内容写入指定的 XmlWriter。Writes the contents of the TextSyndicationContent to the specified XmlWriter. |
| WriteTo(XmlWriter, String, String) |
在指定的元素和元素命名空间中,将此对象的内容写入指定的 XmlWriter。Writes the contents of this object to the specified XmlWriter within the specified element and element namespace. (继承自 SyndicationContent) |