SyndicationItem.Authors Propriedade
Definição
Obtém os autores do item de sindicalização.Gets the authors of the syndication item.
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)
Valor da propriedade
Uma coleção de SyndicationPerson objetos que representam os autores do item de distribuição.A collection of SyndicationPerson objects that represent the authors of the syndication item.
Exemplos
O código a seguir mostra como adicionar um autor à Authors coleção de um SyndicationItem .The following code shows how to add an author to the Authors collection of a 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"))
O XML a seguir mostra como o anterior SyndicationItem é serializado para Atom 1,0.The following XML shows how the preceding SyndicationItem is serialized to 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>
O XML a seguir mostra como o anterior SyndicationItem é serializado para RSS 2,0.The following XML shows how the preceding SyndicationItem is serialized to RSS 2.0.
<item>
<guid isPermaLink="false">Item ID</guid>
<link>http://someserver/MyItem</link>
<author>someone@mycompany.com</author>
<title>Meu item</title>
<description>Este é um conteúdo</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>
Comentários
Ao serializar para Atom 1,0, um <author> elemento é gravado para cada uma SyndicationPerson na Authors coleção.When serializing to Atom 1.0, an <author> element is written for each SyndicationPerson in the Authors collection.
Ao serializar para RSS 2,0.When serializing to RSS 2.0. um <managingEditor> elemento será gravado se a Authors coleção tiver apenas um SyndicationPerson , caso contrário, um <a10:author> elemento será escrito para cada uma SyndicationPerson na Authors coleção.a <managingEditor> element is written if the Authors collection has only one SyndicationPerson, otherwise a <a10:author> element is written for each SyndicationPerson in the Authors collection.