Partilhar via


ConfigurationElement.SerializeElement(XmlWriter, Boolean) Método

Definição

Grava o conteúdo desse elemento de configuração no arquivo de configuração quando implementado em uma classe derivada.

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

Parâmetros

writer
XmlWriter

O XmlWriter que grava no arquivo de configuração.

serializeCollectionKey
Boolean

true para serializar apenas as propriedades de chave da coleção; caso contrário, false.

Retornos

true se algum dado realmente foi serializado; caso contrário, false.

Exceções

O atributo atual está bloqueado em um nível de configuração superior.

Exemplos

O exemplo a seguir mostra como estender o SerializeElement método .

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

Aplica-se a