public override void WriteResult(ITraceResult results) { Formatter.Format(results); using (var writer = Console.Out) { writer.Write(Formatter.GetFormat()); } }
public void Format(ITraceResult traceResult) { var xmlSerializer = new XmlSerializer(typeof(XmlTraceResult)); using (var textWriter = new StringWriter()) { xmlSerializer.Serialize(textWriter, TraceResulToXmlMapper.MapToXml(traceResult)); _output = textWriter.ToString(); } }
public override void WriteResult(ITraceResult results) { Formatter.Format(results); if (filePath == null) { throw new FileNotFoundException(); } using (TextWriter writer = File.CreateText(filePath)) { writer.Write(Formatter.GetFormat()); } }
internal static XmlTraceResult MapToXml(ITraceResult traceResult) { XmlTraceResult xmlTraceResult = new XmlTraceResult { Root = new List <XmlThreadNode>(), }; foreach (var thread in traceResult.Root) { xmlTraceResult.Root.Add(ThreadNodeMap(thread)); } return(xmlTraceResult); }
public void Format(ITraceResult traceResult) { var strBuilder = new StringBuilder(); strBuilder.AppendLine("root"); foreach (var thread in traceResult.Root) { strBuilder.AppendFormat(" thread id={0}, time={1} ms\n", thread.ThreadId, thread.ThreadId); AddMethodNodeInfo(thread.Root, strBuilder, 1); strBuilder.AppendLine(" thread"); } strBuilder.AppendLine("root"); Output = strBuilder.ToString(); }
public void Format(ITraceResult traceResult) { var result = JsonConvert.SerializeObject(traceResult, Formatting.Indented); Output = result; }
public abstract void WriteResult(ITraceResult results);
public void Format(ITraceResult traceResult) { var serializer = new SerializerBuilder().Build(); _output = serializer.Serialize(traceResult); }