Επεξεργασία

Κοινή χρήση μέσω


ConfigurationElementCollection.SerializeElement(XmlWriter, Boolean) Method

Definition

Writes the configuration data to an XML element in the configuration file when overridden in a derived class.

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);
protected override bool SerializeElement (System.Xml.XmlWriter writer, bool serializeCollectionKey);
override this.SerializeElement : System.Xml.XmlWriter * bool -> bool
Protected Friend Overrides Function SerializeElement (writer As XmlWriter, serializeCollectionKey As Boolean) As Boolean
Protected Overrides Function SerializeElement (writer As XmlWriter, serializeCollectionKey As Boolean) As Boolean

Parameters

writer
XmlWriter

Output stream that writes XML to the configuration file.

serializeCollectionKey
Boolean

true to serialize the collection key; otherwise, false.

Returns

true if the ConfigurationElementCollection was written to the configuration file successfully.

Exceptions

One of the elements in the collection was added or replaced and starts with the reserved prefix "config" or "lock".

Remarks

The SerializeElement method writes the contents of the configuration elements contained in the collection and any nested elements they contain to the configuration file. Override SerializeElement to provide a custom write procedure out of the collection contents and nested elements.

Applies to