ConfigurationElement.SerializeElement(XmlWriter, Boolean) ConfigurationElement.SerializeElement(XmlWriter, Boolean) ConfigurationElement.SerializeElement(XmlWriter, Boolean) ConfigurationElement.SerializeElement(XmlWriter, Boolean) Method

Definizione

Scrive il contenuto di questo elemento di configurazione nel file di configurazione in caso di implementazione in una classe derivata.Writes the contents of this configuration element to the configuration file when implemented in a derived class.

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

Parametri

writer
XmlWriter XmlWriter XmlWriter XmlWriter

Oggetto XmlWriter che scrive nel file di configurazione.The XmlWriter that writes to the configuration file.

serializeCollectionKey
Boolean Boolean Boolean Boolean

true per serializzare solo le proprietà chiave della raccolta. In caso contrario, false.true to serialize only the collection key properties; otherwise, false.

Restituisce

true se i dati sono stati effettivamente serializzati; in caso contrario, false.true if any data was actually serialized; otherwise, false.

Eccezioni

L'attributo corrente è bloccato a un livello di configurazione superiore.The current attribute is locked at a higher configuration level.

Esempi

Nell'esempio seguente viene illustrato come estendere il SerializeElement (metodo).The following example shows how to extend the SerializeElement method.

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