SyndicationFeed.Contributors 屬性

定義

為摘要取得參與者的集合。

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

屬性值

Collection<SyndicationPerson>

代表摘要的參與者之 SyndicationPerson 物件的集合。

範例

下列程式碼會示範如何將參與者加入至 ContributorsSyndicationFeed 集合。

SyndicationFeed feed = new SyndicationFeed("Feed Title", "Feed Description", new Uri("http://Feed/Alternate/Link"), "FeedID", DateTime.Now);
feed.Contributors.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.Contributors.Add(New SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http:'contoso/jesper"))

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

<contributor>
  <name>Lene Aalling</name>
  <uri>http://contoso/Aalling</uri>
  <email>Lene.Aaling@contoso.com</email>
</contributor>

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

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

備註

當序列化為 Atom 1.0 時,集合中的每個都會 SyndicationPerson 寫入元素 <contributor>

序列化為 RSS 2.0 時,集合中的每個都會 SyndicationPerson 寫入元素 <a10:contributor>

適用於