ConfigurationElement.SerializeElement(XmlWriter, Boolean) Metodo

Definizione

Scrive il contenuto di questo elemento di configurazione nel file di configurazione quando implementato in una classe derivata.

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);
protected 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 Friend Overridable Function SerializeElement (writer As XmlWriter, serializeCollectionKey As Boolean) As Boolean
Protected Overridable Function SerializeElement (writer As XmlWriter, serializeCollectionKey As Boolean) As Boolean

Parametri

writer
XmlWriter

Oggetto XmlWriter che scrive nel file di configurazione.

serializeCollectionKey
Boolean

true per serializzare solo le proprietà della chiave di raccolta; in caso contrario, false.

Valori restituiti

true se i dati sono stati effettivamente serializzati; in caso contrario, false.

Eccezioni

L'attributo corrente è bloccato a un livello di configurazione superiore.

Esempio

Nell'esempio seguente viene illustrato come estendere il SerializeElement metodo .

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

Si applica a