ConfigurationElement.SerializeToXmlElement(XmlWriter, String) ConfigurationElement.SerializeToXmlElement(XmlWriter, String) ConfigurationElement.SerializeToXmlElement(XmlWriter, String) ConfigurationElement.SerializeToXmlElement(XmlWriter, String) Method

定義

在衍生類別中實作時,將此組態項目的外部標記寫入組態檔中。Writes the outer tags of this configuration element to the configuration file when implemented in a derived class.

protected public:
 virtual bool SerializeToXmlElement(System::Xml::XmlWriter ^ writer, System::String ^ elementName);
protected internal virtual bool SerializeToXmlElement (System.Xml.XmlWriter writer, string elementName);
abstract member SerializeToXmlElement : System.Xml.XmlWriter * string -> bool
override this.SerializeToXmlElement : System.Xml.XmlWriter * string -> bool
Protected Friend Overridable Function SerializeToXmlElement (writer As XmlWriter, elementName As String) As Boolean

參數

writer
XmlWriter XmlWriter XmlWriter XmlWriter

要寫入組態檔的 XmlWriterThe XmlWriter that writes to the configuration file.

elementName
String String String String

要寫入的 ConfigurationElement 名稱。The name of the ConfigurationElement to be written.

傳回

如果寫入成功,則為 true,否則為 falsetrue if writing was successful; otherwise, false.

例外狀況

此項目具有多個子項目。The element has multiple child elements.

備註

在序列化期間呼叫 Unmerge 方法之後,會呼叫 SerializeToXmlElement 方法。The SerializeToXmlElement method is called after the call to the Unmerge method during serialization. @No__t-0 方法會寫出專案的開頭和結束記號之間的 configuration 元素內容。The SerializeToXmlElement method writes out the contents of the configuration element between the beginning and ending tags of the element. 覆寫 SerializeToXmlElement,以提供自訂的序列化方法。Override SerializeToXmlElement to provide a custom serialization method.

適用於