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方法之后调用。 SerializeToXmlElementThe SerializeToXmlElement method is called after the call to the Unmerge method during serialization. SerializeToXmlElement方法写出元素的开始标记和结束标记之间的配置元素的内容。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.

适用于