Export (0) Print
Expand All

SyndicationPerson.Name Property

Gets and sets the name of the SyndicationPerson.

Namespace:  System.ServiceModel.Syndication
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public string Name { get; set; }

Property Value

Type: System.String
The name of the person.

When serialized to Atom 1.0, the Name property is written as a <name> element. The <name> element appears within an <author> or <contributor> element, which depends upon which collection (authors or contributors) the SyndicationPerson is added to.

When serialized to RSS 2.0, the Name property is written as an <a10:name> element. The <a10:name> element appears within a <managingEditor>, <a10:author>, or <a10:contributor> element. If only one SyndicationPerson is added to the authors collection, the <a10:name> element is written within the <managingEditor> element. If more than one SyndicationPerson is added to the authors collection, the <a10:name> element is written within the <a10:author> element. If the SyndicationPerson is added to the contributors collection, the <a10:name> element is written within the <a10:contributor> element.

The following code shows how to set the name of a SyndicationPerson.

SyndicationPerson sp = new SyndicationPerson();
sp.Name = "Jesper Aaberg";

The following XML shows how the Name is serialized for Atom 1.0.

<author>
  <name>Jesper Aaberg</name>
  <uri>http://Jesper/Aaberg</uri>
  <email>Jesper.Aaberg@contoso.com</email>
</author>
<contributor>
  <name>Lene Aalling</name>
  <uri>http://Lene/Aaling</uri>
  <email>Lene.Aaling@contoso.com</email>
</contributor>

The following XML shows how the Name is serialized for RSS 2.0.

<a10:author>
  <a10:name>Lene Aalling</a10:name>
  <a10:uri>http://Lene/Aalling</a10:uri>
  <a10:email>Lene.Aalling@contoso.com</a10:email>
</a10:author>
  <a10:contributor>
  <a10:name>Jesper Aaberg</a10:name>
  <a10:uri>http://Jesper/Aaberg</a10:uri>
  <a10:email>Jesper.Aaberg@contoso.com</a10:email>
</a10:contributor>

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft