Table of Contents

ToXmlReader Method

Definition

Namespace
Cuemon.Xml
Assemblies
Cuemon.Xml.dll
Source
src/Cuemon.Xml/Extensions/StreamDecoratorExtensions.cs

ToXmlReader(IDecorator<Stream>, Encoding, Action<XmlReaderSettings>)

Converts the enclosed Stream of the specified decorator to an XmlReader.

public static XmlReader ToXmlReader(this IDecorator<Stream> decorator, Encoding encoding = null, Action<XmlReaderSettings> setup = null)

Parameters

decorator IDecorator<Stream>

The IDecorator<T> to extend.

encoding Encoding

The text encoding to use.

setup Action<XmlReaderSettings>

The XmlReaderSettings which may be configured.

Returns

XmlReader

An XmlReader representation of the enclosed Stream of the specified decorator.

Remarks

If encoding is null, an Encoding object will be attempted resolved by TryDetectXmlEncoding(IDecorator<Stream>, out Encoding).

Exceptions

ArgumentNullException

decorator cannot be null.