Share via


SyndicationFeed.Authors 屬性

定義

取得摘要作者的集合。

public:
 property System::Collections::ObjectModel::Collection<System::ServiceModel::Syndication::SyndicationPerson ^> ^ Authors { System::Collections::ObjectModel::Collection<System::ServiceModel::Syndication::SyndicationPerson ^> ^ get(); };
public System.Collections.ObjectModel.Collection<System.ServiceModel.Syndication.SyndicationPerson> Authors { get; }
member this.Authors : System.Collections.ObjectModel.Collection<System.ServiceModel.Syndication.SyndicationPerson>
Public ReadOnly Property Authors As Collection(Of SyndicationPerson)

屬性值

Collection<SyndicationPerson>

表示摘要作者的 SyndicationPerson 物件集合。

範例

下列程式碼會示範如何將作者加入至 AuthorsSyndicationFeed 集合。

SyndicationFeed feed = new SyndicationFeed("Feed Title", "Feed Description", new Uri("http://Feed/Alternate/Link"), "FeedID", DateTime.Now);
feed.Authors.Add(new SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http://contoso/jesper"));
Dim feed As New SyndicationFeed("Feed Title", "Feed Description", New Uri("http:'Feed/Alternate/Link"), "FeedID", DateTime.Now)
feed.Authors.Add(New SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http:'contoso/jesper"))

下列 XML 會說明 Authors 集合如何序列化為 Atom 1.0。

<author>
  <name>Jesper Aaberg</name>
  <uri>http://contoso/Aaberg</uri>
  <email>Jesper.Asberg@contoso.com</email>
</author>

下列 XML 會說明 Authors 集合如何序列化為 RSS 2.0。

<a10:author>
  <a10:name>Lene Aalling</a10:name>
  <a10:uri>http://contoso/Aalling</a10:uri>
  <a10:email>Lene.Aalling@contoso.com</a10:email>
</a10:author>

備註

當序列化為 Atom 1.0 時,集合中的每個都會 SyndicationPerson 寫入元素 <author> 。 當序列化為 RSS 2.0 時,如果集合中只有單 SyndicationPerson 一存在,則會寫入 <managingEditor> 專案。 否則,每個都會 SyndicationPerson 寫入專案 <a10:author>

適用於