ConfigurationElement.SerializeElement(XmlWriter, Boolean) Yöntem

Tanım

Bu yapılandırma öğesinin içeriğini türetilmiş bir sınıfta uygulandığında yapılandırma dosyasına yazar.Writes the contents of this configuration element to the configuration file when implemented in a derived class.

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

Parametreler

writer
XmlWriter

XmlWriterYapılandırma dosyasına yazar.The XmlWriter that writes to the configuration file.

serializeCollectionKey
Boolean

trueyalnızca koleksiyon anahtarı özelliklerini seri hale getirmek için; Aksi takdirde, false .true to serialize only the collection key properties; otherwise, false.

Döndürülenler

Boolean

trueverilerin gerçekten serileştirildiği takdirde Aksi takdirde, false .true if any data was actually serialized; otherwise, false.

Özel durumlar

Geçerli öznitelik daha yüksek bir yapılandırma düzeyinde kilitli.The current attribute is locked at a higher configuration level.

Örnekler

Aşağıdaki örnek, yönteminin nasıl genişletileceğini gösterir SerializeElement .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

Şunlara uygulanır