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
Samarbeid med oss på GitHub
Du finner kilden for dette innholdet på GitHub. Der du også kan opprette og se gjennom problemer og pull-forespørsler. Hvis du vil ha mer informasjon, kan du se vår bidragsyterveiledning.