void OnReadXml(object sender, string text)
{
if (!DebugProtocol) {
return;
}
try {
var strWriter = new StringWriter();
var xmlWriter = new XmlTextWriter(strWriter);
xmlWriter.Formatting = Formatting.Indented;
xmlWriter.Indentation = 2;
xmlWriter.IndentChar = ' ';
var document = new XmlDocument();
document.LoadXml(text);
document.WriteContentTo(xmlWriter);
DebugRead("\n" + strWriter.ToString());
} catch (XmlException) {
DebugRead("\n" + text);
} catch (Exception ex) {
#if LOG4NET
_Logger.Error("OnProtocol(): Exception", ex);
#endif
}
}