XmlIgnoreAttribute Constructor
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.
Initializes a new instance of the XmlIgnoreAttribute class.
public:
XmlIgnoreAttribute();
public XmlIgnoreAttribute ();
Public Sub New ()
Examples
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 ref class Group
{
public:
// The XmlSerializer ignores this field.
[XmlIgnore]
String^ Comment;
// The XmlSerializer serializes this field.
String^ GroupName;
};
public class Group
{
// The XmlSerializer ignores this field.
[XmlIgnore]
public string Comment;
// The XmlSerializer serializes this field.
public string GroupName;
}
Public Class Group
' the XmlSerializer ignores this field.
<XmlIgnore()> Public Comment As String
' The XmlSerializer serializes this field.
Public GroupName As String
End Class
Applies to
See also
Surađujte s nama na GitHubu
Izvor za ovaj sadržaj možete pronaći na GitHubu, gdje možete stvarati i pregledavati probleme i zahtjeve za povlačenjem. Dodatne informacije potražite u našem vodiču za suradnike.