Bagikan melalui


ConfigurationElement.SerializeElement(XmlWriter, Boolean) Metode

Definisi

Menulis konten elemen konfigurasi ini ke file konfigurasi saat diimplementasikan di kelas turunan.

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

XmlWriter yang menulis ke file konfigurasi.

serializeCollectionKey
Boolean

true untuk menserialisasikan hanya properti kunci koleksi; jika tidak, false.

Mengembalikan

true jika ada data yang benar-benar diserialisasikan; jika tidak, false.

Pengecualian

Atribut saat ini dikunci pada tingkat konfigurasi yang lebih tinggi.

Contoh

Contoh berikut menunjukkan cara memperluas SerializeElement metode .

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

Berlaku untuk