ConfigurationElement.SerializeElement(XmlWriter, Boolean) Metoda

Definice

Zapíše obsah tohoto konfiguračního prvku do konfiguračního souboru při implementaci v odvozené třídě.

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

Parametry

writer
XmlWriter

Ten XmlWriter , který zapisuje do konfiguračního souboru.

serializeCollectionKey
Boolean

trueserializovat pouze vlastnosti klíče kolekce; v opačném případě . false

Návraty

truepokud byla nějaká data skutečně serializována; v opačném případě . false

Výjimky

Aktuální atribut je uzamčen na vyšší úrovni konfigurace.

Příklady

Následující příklad ukazuje, jak rozšířit metodu SerializeElement .

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

Platí pro