XmlIgnoreAttribute Konstruktor

Definicja

Inicjuje nowe wystąpienie klasy XmlIgnoreAttribute.

public:
 XmlIgnoreAttribute();
public XmlIgnoreAttribute();
Public Sub New ()

Przykłady

W poniższym przykładzie przedstawiono klasę o nazwie Group, która zawiera pole o nazwie Comment. W przykładzie przypisano XmlIgnoreAttribute element do pola, co powoduje zignorowanie XmlSerializer pola podczas serializacji lub deserializacji wystąpienia klasy.

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

Dotyczy

Zobacz też