ConfigurationElement.SerializeElement(XmlWriter, Boolean) Méthode

Définition

Écrit le contenu de cet élément de configuration dans le fichier de configuration lorsqu'il est implémenté dans une classe dérivée.

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

Paramètres

writer
XmlWriter

XmlWriter écrivant dans le fichier de configuration.

serializeCollectionKey
Boolean

true pour sérialiser uniquement les propriétés clés de la collection ; sinon false.

Retours

Boolean

true si les données ont été correctement sérialisées ; sinon, false.

Exceptions

L'attribut actuel est verrouillé à un niveau de configuration supérieur.

Exemples

L’exemple suivant montre comment étendre la SerializeElement méthode.

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

S’applique à