SyndicationItem.Authors Egenskap
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Hämtar syndikeringsobjektets författare.
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 syndikeringsobjektets författare.
Exempel
Följande kod visar hur du lägger till en författare i Authors samlingen av en SyndicationItem.
SyndicationItem item = new SyndicationItem("Item Title", "Item Content", new Uri("http://Item/Alternate/Link"));
item.Authors.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.Authors.Add(New SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http:' contoso/jesper"))
Följande XML visar hur föregående SyndicationItem serialiseras till Atom 1.0.
<entry>
<id>Item ID</id>
<title type="text">My Item</title>
<updated>2007-03-16T23:00:59Z</updated>
<author>
<name>Lene Aaling</name>
<uri>http://contoso/Lene</uri>
<email>lene@contoso.com</email>
</author>
<link rel="alternate" href="http://someserver/MyItem" />
<link rel="alternate" type="text/html" title="Alternate Link" length="1000" href="http://otherserver/Item" />
<content type="text">This is some content</content>
</entry>
Följande XML visar hur föregående SyndicationItem serialiseras till RSS 2.0.
<item>
<guid isPermaLink="false">Item ID</guid>
<link>http://someserver/MyItem</link>
<author>someone@mycompany.com</author>
<title>My Item</title>
<description>This is some content</description>
<a10:link rel="alternate" type="text/html" title="Alternate Link" length="1000" href="http://otherserver/Item" />
<a10:updated>2007-03-16T23:00:59Z</a10:updated>
</item>
Kommentarer
När du serialiserar till Atom 1.0 skrivs ett element för var och <author> en SyndicationPerson i Authors samlingen.
Vid serialisering till RSS 2.0. ett <managingEditor> element skrivs om Authors samlingen bara har ett SyndicationPerson, annars skrivs ett element för var och <a10:author> en SyndicationPerson i Authors samlingen.