internal PortSet <string, Exception> DeserializeEnvelopeBody(loganalyzer.Envelope envelope) { var xmlResultPort = new PortSet <XmlWriter, Exception>(); var o = loganalyzer.DssLogAnalyzerHelper.DeserializeEnvelope(envelope).Body; var stringbuilderOutput = new StringBuilder(); var xmlWriter = XmlWriter.Create(stringbuilderOutput, new XmlWriterSettings { Indent = true }); var ser = new SerializeToXmlWriter(o, xmlWriter, xmlResultPort); SerializerPort.Post(ser); var resultPort = new PortSet <string, Exception>(); Activate( Arbiter.Choice( xmlResultPort, success => resultPort.Post(stringbuilderOutput.ToString()), failure => resultPort.Post(failure))); return(resultPort); }
/// <summary> /// Deserializes the envelope body. /// </summary> /// <param name="envelope">The envelope.</param> /// <param name="callback">The callback.</param> internal void DeserializeEnvelopeBody(loganalyzer.Envelope envelope, Action <string> callback) { Activate( Arbiter.Choice( DeserializeEnvelopeBody(envelope), text => this.wpfServicePort.Invoke(() => callback(text)), failure => LogError(failure))); }