XmlReader.ReadElementContentAsObject Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Reads the current element and returns the contents as an Object.
Assembly: System.Xml (in System.Xml.dll)
Return Value
Type: System.ObjectA boxed common language runtime (CLR) object of the most appropriate type. The ValueType property determines the appropriate CLR type. If the content is typed as a list type, this method returns an array of boxed objects of the appropriate type.
| Exception | Condition |
|---|---|
| InvalidOperationException | The XmlReader is not positioned on an element. |
| XmlException | The current element contains child elements. -or- The element content cannot be converted to the requested type |
| ArgumentNullException | The method is called with null arguments. |
Show: