ConfigurationElementCollection.SerializeElement(XmlWriter, Boolean) 方法

定義

在衍生類別中覆寫時,將組態資料寫入組態檔的 XML 項目中。

protected:
 override bool SerializeElement(System::Xml::XmlWriter ^ writer, bool serializeCollectionKey);
protected public:
 override bool SerializeElement(System::Xml::XmlWriter ^ writer, bool serializeCollectionKey);
protected override bool SerializeElement (System.Xml.XmlWriter writer, bool serializeCollectionKey);
protected internal override bool SerializeElement (System.Xml.XmlWriter writer, bool serializeCollectionKey);
override this.SerializeElement : System.Xml.XmlWriter * bool -> bool
Protected Overrides Function SerializeElement (writer As XmlWriter, serializeCollectionKey As Boolean) As Boolean
Protected Friend Overrides Function SerializeElement (writer As XmlWriter, serializeCollectionKey As Boolean) As Boolean

參數

writer
XmlWriter

將 XML 寫入組態檔的輸出資料流。

serializeCollectionKey
Boolean

true 表示序列化集合索引鍵,否則為 false

傳回

如果 ConfigurationElementCollection 成功寫入組態檔,則為 true

例外狀況

已加入或取代集合中的其中一個項目,且此項目以 "config" 或 "lock" 做為開頭。

備註

方法 SerializeElement 會寫入集合中包含的組態項目內容,以及它們所包含的任何巢狀專案至組態檔。 覆寫 SerializeElement 以提供集合內容和巢狀專案外自定義寫入程式。

適用於