SyndicationFeed.Authors Egenskap

Definition

Hämtar en samling författare av feeden.

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)

Egenskapsvärde

En samling SyndicationPerson objekt som representerar flödesförfattarna.

Exempel

Följande kod visar hur du lägger till en författare i Authors samlingen av en 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"))

Följande XML visar hur Authors samlingen serialiseras till Atom 1.0.

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

Följande XML visar hur Authors samlingen serialiseras till 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>

Kommentarer

När den serialiseras till Atom 1.0 skrivs var och SyndicationPerson en i samlingen till ett <author> element. Om endast en enda SyndicationPerson finns i samlingen skrivs den till ett <managingEditor> element när den serialiseras till RSS 2.0. Annars skrivs var och SyndicationPerson en till ett <a10:author> element.

Gäller för