XmlSerializer Constructor (XmlTypeMapping)
Initializes an instance of the XmlSerializer class using an object that maps one type to another.
Assembly: System.Xml (in System.Xml.dll)
The following example serializes a class named Group. The serialization of the GroupName, IgnoreThis fields, and the members of the GroupType enumeration are overridden. In the CreateOverrideSerializer method, a SoapAttributeOverrides object is created, and for each overridden member or enumeration, a SoapAttributes object is created with the appropriate property set and added to the SoapAttributeOverrides object. An XmlMapping object is created using the SoapAttributeOverrides object, and that XmlMapping object is used to create the XmlSerializer that overrides the default serialization.
.NET FrameworkSupported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1
.NET Framework Client ProfileSupported in: 4, 3.5 SP1
XNA FrameworkSupported in: 3.0, 2.0, 1.0
Portable Class LibraryObsolete (compiler warning) in Portable Class Library
Supported in: Windows Phone 8.1
Supported in: Windows Phone Silverlight 8.1
Supported in: Windows Phone Silverlight 8