Writes the contents of this configuration element to the configuration file when implemented in a derived class.
Assembly: System.Configuration (in System.Configuration.dll)
Syntax
Protected Friend Overridable Function SerializeElement ( _
writer As [%$TOPIC/ms134137_en-us_VS_110_1_0_0_0_0%], _
serializeCollectionKey As [%$TOPIC/ms134137_en-us_VS_110_1_0_0_0_1%] _
) As [%$TOPIC/ms134137_en-us_VS_110_1_0_0_0_2%]
protected internal virtual [%$TOPIC/ms134137_en-us_VS_110_1_0_1_0_0%] SerializeElement(
[%$TOPIC/ms134137_en-us_VS_110_1_0_1_0_1%] writer,
[%$TOPIC/ms134137_en-us_VS_110_1_0_1_0_2%] serializeCollectionKey
)
protected public:
virtual [%$TOPIC/ms134137_en-us_VS_110_1_0_2_0_0%] SerializeElement(
[%$TOPIC/ms134137_en-us_VS_110_1_0_2_0_1%]^ writer,
[%$TOPIC/ms134137_en-us_VS_110_1_0_2_0_2%] serializeCollectionKey
)
abstract SerializeElement :
writer:[%$TOPIC/ms134137_en-us_VS_110_1_0_3_0_0%] *
serializeCollectionKey:[%$TOPIC/ms134137_en-us_VS_110_1_0_3_0_1%] -> [%$TOPIC/ms134137_en-us_VS_110_1_0_3_0_2%]
override SerializeElement :
writer:[%$TOPIC/ms134137_en-us_VS_110_1_0_3_0_3%] *
serializeCollectionKey:[%$TOPIC/ms134137_en-us_VS_110_1_0_3_0_4%] -> [%$TOPIC/ms134137_en-us_VS_110_1_0_3_0_5%]
Parameters
- writer
- Type:
System.XmlXmlWriter
The XmlWriter that writes to the configuration file.
- serializeCollectionKey
- Type:
SystemBoolean
true to serialize only the collection key properties; otherwise, false.
Exceptions
| Exception | Condition |
|---|---|
| ConfigurationErrorsException | The current attribute is locked at a higher configuration level. |
Examples
The following example shows how to extend the SerializeElement method.
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
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;
}
Platforms
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.