SyndicationFeed.Description 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定摘要的描述。
public:
property System::ServiceModel::Syndication::TextSyndicationContent ^ Description { System::ServiceModel::Syndication::TextSyndicationContent ^ get(); void set(System::ServiceModel::Syndication::TextSyndicationContent ^ value); };
public System.ServiceModel.Syndication.TextSyndicationContent Description { get; set; }
member this.Description : System.ServiceModel.Syndication.TextSyndicationContent with get, set
Public Property Description As TextSyndicationContent
屬性值
表示摘要描述的 TextSyndicationContent 物件。
範例
下列程式碼會示範如何設定 Description 的 SyndicationFeed。
List<SyndicationItem> items = new List<SyndicationItem>();
SyndicationItem item1 = new SyndicationItem();
item1.Title = new TextSyndicationContent("Item 1");
item1.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 1");
items.Add(item1);
SyndicationItem item2 = new SyndicationItem();
item2.Title = new TextSyndicationContent("Item 2");
item2.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 2");
items.Add(item2);
SyndicationFeed feed = new SyndicationFeed(items);
feed.Description = new TextSyndicationContent("This is a feed description");
Dim items As New List(Of SyndicationItem)()
Dim item1 As New SyndicationItem()
item1.Title = New TextSyndicationContent("Item 1")
item1.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 1")
items.Add(item1)
Dim item2 As New SyndicationItem()
item2.Title = New TextSyndicationContent("Item 2")
item2.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 2")
items.Add(item2)
Dim feed As New SyndicationFeed(items)
feed.Description = New TextSyndicationContent("This is a feed description")
下列 XML 會顯示 Description 如何序列化為 Atom 1.0。
<subtitle type="text">This is a sample feed</subtitle>
下列 XML 會說明 Description 如何序列化為 RSS 2.0。
<description>這是範例摘要</description>
備註
當序列化為 Atom 1.0 時, Description 會寫入專案 <subtitle>
。
序列化為 RSS 2.0 時, Description 會寫入專案 <description>
。