InitializeXmlReader static method
Initializes the XML reader.
The stream.
Implementation
static Future<XmlReader> InitializeXmlReader(Stream stream) async {
// The ProhibitDtd property is used to indicate whether XmlReader should process DTDs or not. By default,
// it will do so. EWS doesn't use DTD references so we want to turn this off. Also, the XmlResolver property is
// set to an instance of XmlUrlResolver by default. We don't want XmlTextReader to try to resolve this DTD reference
// so we disable the XmlResolver as well.
// The C# XmlReaderSettings (IgnoreComments, IgnoreProcessingInstructions,
// IgnoreWhitespace, no DTD processing) are applied by XmlReader's event
// normalizer (XmlNormalizeEvents); entities are never resolved.
return await XmlReader.Create(stream as Stream<List<int>>);
}