static void Main() { threads = new List <Thread>(); tracer = new Tracer(); MultipleThreadMethod(); var tracerResult = tracer.GetTraceResult(); var tracerResultList = new List <ThreadResult>(); tracerResultList.AddRange(tracerResult.ThreadResults.Values); var jsonSerializer = new JsonCustomSerializer(); var jsonSerializedText = jsonSerializer.Serialize(tracerResultList); var xmlSerializer = new XmlCustomSerializer(); var xmlSerializedText = xmlSerializer.Serialize(tracerResultList); var fileOutputResult = new FileOutput(); var consoleOutputResult = new ConsoleOutput(); fileOutputResult.OutputData(jsonSerializedText, ".json"); fileOutputResult.OutputData(xmlSerializedText, ".xml"); consoleOutputResult.OutputData(jsonSerializedText); consoleOutputResult.OutputData(xmlSerializedText); Console.ReadLine(); }