XmlEnumAttribute::Name Property
Gets or sets the value generated in an XML-document instance when the XmlSerializer serializes an enumeration, or the value recognized when it deserializes the enumeration member.
Assembly: System.Xml (in System.Xml.dll)
Property Value
Type: System::String^The value generated in an XML-document instance when the XmlSerializer serializes the enumeration, or the value recognized when it is deserializes the enumeration member.
Specify the Name when you want the generated XML data to differ from the enumeration identifier.
Note |
|---|
You can use the word XmlEnum in your code instead of the longer XmlEnumAttribute. |
The following example applies the XmlEnumAttribute attribute to members of an enumeration. The generated XML data conforms to the values set for the Name property.
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
