Export (0) Print
Expand All

ConfigurationElement.DeserializeElement Method

Reads XML from the configuration file.

Namespace: System.Configuration
Assembly: System.Configuration (in system.configuration.dll)

protected internal virtual void DeserializeElement (
	XmlReader reader,
	bool serializeCollectionKey
)
protected void DeserializeElement (
	XmlReader reader, 
	boolean serializeCollectionKey
)
protected internal function DeserializeElement (
	reader : XmlReader, 
	serializeCollectionKey : boolean
)
Not applicable.

Parameters

reader

The XmlReader that reads from the configuration file.

serializeCollectionKey

true to serialize only the collection key properties; otherwise, false.

Exception typeCondition

ConfigurationErrorsException

The element to read is locked.

- or -

An attribute of the current node is not recognized.

- or -

The lock status of the current node cannot be determined.

The following example demonstrates how to extend the DeserializeElement method.

protected override void DeserializeElement(
   System.Xml.XmlReader reader, 
    bool serializeCollectionKey)
{
    base.DeserializeElement(reader, 
        serializeCollectionKey);

    // Enter your custom processing code here.
    if (_displayIt)
    {
        Console.WriteLine(
           "UrlConfigElement.DeserializeElement({0}, {1}) called",
           (reader == null) ? "null" : reader.ToString(),
           serializeCollectionKey.ToString());
    }
}

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft