SyndicationFeed.Authors Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a collection of authors of the feed.
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)
Property Value
A collection of SyndicationPerson objects that represents the authors of the feed.
Examples
The following code shows how to add an author to the Authors collection of a 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"))
The following XML shows how the Authors collection is serialized to Atom 1.0.
<author>
<name>Jesper Aaberg</name>
<uri>http://contoso/Aaberg</uri>
<email>Jesper.Asberg@contoso.com</email>
</author>
The following XML shows how the Authors collection is serialized to 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>
Remarks
When serialized to Atom 1.0, each SyndicationPerson in the collection is written to an <author>
element. When serialized to RSS 2.0, if only a single SyndicationPerson exists in the collection, it is written to a <managingEditor>
element. Otherwise, each SyndicationPerson is written to an <a10:author>
element.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈