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>

适用于