ConfigurationElement.SerializeElement(XmlWriter, Boolean) Methode

Definition

Schreibt bei Implementierung in einer abgeleiteten Klasse den Inhalt dieses Konfigurationselements in die Konfigurationsdatei.

protected:
 virtual bool SerializeElement(System::Xml::XmlWriter ^ writer, bool serializeCollectionKey);
protected public:
 virtual bool SerializeElement(System::Xml::XmlWriter ^ writer, bool serializeCollectionKey);
protected virtual bool SerializeElement (System.Xml.XmlWriter writer, bool serializeCollectionKey);
protected internal virtual bool SerializeElement (System.Xml.XmlWriter writer, bool serializeCollectionKey);
abstract member SerializeElement : System.Xml.XmlWriter * bool -> bool
override this.SerializeElement : System.Xml.XmlWriter * bool -> bool
Protected Overridable Function SerializeElement (writer As XmlWriter, serializeCollectionKey As Boolean) As Boolean
Protected Friend Overridable Function SerializeElement (writer As XmlWriter, serializeCollectionKey As Boolean) As Boolean

Parameter

writer
XmlWriter

Der XmlWriter, der in die Konfigurationsdatei schreibt.

serializeCollectionKey
Boolean

true, um nur die Auflistungsschlüsseleigenschaften zu serialisieren, andernfalls false.

Gibt zurück

true, wenn tatsächlich Daten serialisiert wurden, andernfalls false.

Ausnahmen

Das aktuelle Attribut ist auf einer höheren Konfigurationsebene gesperrt.

Beispiele

Im folgenden Beispiel wird gezeigt, wie die SerializeElement -Methode erweitert wird.

protected override bool SerializeElement(
    System.Xml.XmlWriter writer, 
    bool serializeCollectionKey)
{
    bool ret = base.SerializeElement(writer, 
        serializeCollectionKey);
    // You can enter your custom processing code here.
    return ret;
}
Protected Overrides Function SerializeElement(ByVal writer _
    As System.Xml.XmlWriter, _
    ByVal serializeCollectionKey As Boolean) As Boolean

    Dim ret As Boolean = _
        MyBase.SerializeElement(writer, serializeCollectionKey)
    ' Enter your custom processing code here.
    Return ret
End Function 'SerializeElement

Gilt für: