Udostępnij za pośrednictwem


IXmlSerializable.ReadXml Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Generates an object from its XML representation.

Namespace:  System.Xml.Serialization
Assembly:  System.Xml (in System.Xml.dll)

Syntax

'Declaration
Sub ReadXml ( _
    reader As XmlReader _
)
void ReadXml(
    XmlReader reader
)

Parameters

Remarks

The implementation you provide for this method must be able to reconstitute your object using the information that was written by the WriteXml() method.

When this method is called, the reader should be positioned at the start of the element that wraps the information for your type. That is, the reader should be positioned just before the start tag that indicates the beginning of a serialized object. When this method returns, it must have read the entire element from beginning to end, including all of its contents.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.