XmlIgnoreAttribute Constructor

XmlIgnoreAttribute Constructor ()


Initializes a new instance of the XmlIgnoreAttribute class.

Namespace:   System.Xml.Serialization
Assembly:  System.Xml (in System.Xml.dll)

public XmlIgnoreAttribute()

The following example shows a class named Group, which contains a field named Comment. The example assigns the XmlIgnoreAttribute to the field, thereby instructing the XmlSerializer to ignore the field when serializing or deserializing an instance of the class.

public class Group
   // The XmlSerializer ignores this field.
   public string Comment;

   // The XmlSerializer serializes this field.
   public string GroupName;

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
© 2015 Microsoft