SyndicationItem.Contributors 属性
定义
获取联合项的参与者。Gets the contributors of the syndication item.
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)
属性值
一个表示联合项参与者的 SyndicationPerson 对象集合。A collection of SyndicationPerson objects that represent the contributors of the syndication item.
示例
下面的代码演示如何将参与者添加到 SyndicationItem。The following code shows how to add a contributor to a SyndicationItem.
SyndicationItem item = new SyndicationItem("Item Title", "Item Content", new Uri("http://Item/Alternate/Link"));
item.Contributors.Add(new SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http://contoso/jesper"));
Dim item As New SyndicationItem("Item Title", "Item Content", New Uri("http:' Item/Alternate/Link"))
item.Contributors.Add(New SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http:' contoso/jesper"))
下面的 XML 演示如何将此属性序列化为 Atom 1.0。The following XML shows how this property is serialized to Atom 1.0.
<contributor>
<name>Lene Aaling</name>
<uri>http://lene/aaling</uri>
<email>lene@contoso.com</email>
</contributor>
下面的 XML 演示如何将此属性序列化为 RSS 2.0。The following XML shows how this property is serialized to RSS 2.0.
<a10:contributor>
<a10:name>Jesper Aaberg</a10:name>
<a10:uri>http://Jesper/Aaberg</a10:uri>
<a10:email>Jesper@company.com</a10:email>
</a10:contributor>
注解
序列化为 Atom 1.0 时,会为 <contributor> 集合中的每个 SyndicationPerson 创建 Contributors 元素。When serialized to Atom 1.0, a <contributor> element is created for each SyndicationPerson in the Contributors collection.
序列化为 RSS 2.0 时,会为 <a10:contributor> 集合中的每个 SyndicationPerson 创建 Contributors 元素。When serialized to RSS 2.0, a <a10:contributor> element is created for each SyndicationPerson in the Contributors collection.