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
التعاون معنا على GitHub
يمكن العثور على مصدر هذا المحتوى على GitHub حيث يمكنك أيضاً إضافة مشاكل وطلبات سحب ومراجعتها. للحصول على معلومات إضافية، اطلع على دليل المساهم لدينا.