SyndicationFeed.Authors Eigenschap

Definitie

Hiermee haalt u een verzameling auteurs van de feed op.

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)

Waarde van eigenschap

Een verzameling SyndicationPerson objecten die de auteurs van de feed vertegenwoordigen.

Voorbeelden

De volgende code laat zien hoe u een auteur toevoegt aan de Authors verzameling van een SyndicationFeed.

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

In de volgende XML ziet u hoe de Authors verzameling wordt geserialiseerd naar Atom 1.0.

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

In de volgende XML ziet u hoe de Authors verzameling wordt geserialiseerd naar 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>

Opmerkingen

Wanneer ze worden geserialiseerd naar Atom 1.0, wordt elk SyndicationPerson in de verzameling naar een <author> element geschreven. Wanneer deze wordt geserialiseerd naar RSS 2.0, als er slechts één SyndicationPerson in de verzameling bestaat, wordt deze naar een <managingEditor> element geschreven. Anders wordt elk SyndicationPerson naar een <a10:author> element geschreven.

Van toepassing op