Redigeeri

Jagamisviis:


SyndicationItem.Contributors Property

Definition

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)

Property Value

A collection of SyndicationPerson objects that represent the contributors of the syndication item.

Examples

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"))

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>

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>

Remarks

When serialized to Atom 1.0, a <contributor> element is created for each SyndicationPerson in the Contributors collection.

When serialized to RSS 2.0, a <a10:contributor> element is created for each SyndicationPerson in the Contributors collection.

Applies to