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
Colaborar conosco no GitHub
A fonte deste conteúdo pode ser encontrada no GitHub, onde você também pode criar e revisar problemas e solicitações de pull. Para obter mais informações, confira o nosso guia para colaboradores.