public void SaveTraceResult(TextWriter textWriter, TracerResult traceResult) { XDocument doc = new XDocument( new XElement("TracerApp", from threadTracerResult in traceResult.dThreadTracerResults.Values select SaveThread(threadTracerResult) )); using (XmlTextWriter xmlWriter = new XmlTextWriter(textWriter)) { xmlWriter.Formatting = Formatting.Indented; doc.WriteTo(xmlWriter); } }
public void SaveTraceResult(TextWriter textWriter, TracerResult traceResult) { var jtokens = from threadTracerResult in traceResult.dThreadTracerResults.Values select SaveThreads(threadTracerResult); JObject traceResultJSON = new JObject { { "Thread", new JArray(jtokens) } }; using (var jsonWriter = new JsonTextWriter(textWriter)) { jsonWriter.Formatting = Formatting.Indented; traceResultJSON.WriteTo(jsonWriter); } }
public TracerResult GetTraceResult() { tracerResult = new TracerResult(cdThreadTracers); return(tracerResult); }