Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Func4();
            Func1();
            Func6();
            Func6();
            Thread thread1 = new Thread(Func5);

            thread1.Start();
            thread1.Join();
            Thread thread2 = new Thread(Func3);

            thread2.Start();
            thread2.Join();
            Thread.Sleep(rnd.Next(sleepTimeCeiling));
            TotalTraceResult      totalTraceResult = tracer.GetTraceResult();
            ITraceResultFormatter consoleFormatter = new ConsoleTraceResultFormatter();

            consoleFormatter.Format(totalTraceResult);
            ITraceResultFormatter xmlFormatter = new XmlTraceResultFormatter(pathToXml);

            xmlFormatter.Format(totalTraceResult);

            Console.Read();
        }
Exemplo n.º 2
0
        private static void OutputInfo()
        {
            var xmlFormatter     = new XmlTraceResultFormatter("TraceResult.xml");
            var consoleFormatter = new ConsoleTraceResultFormatter();

            consoleFormatter.Format(Tracer.GetTraceResult());
            xmlFormatter.Format(Tracer.GetTraceResult());
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Thread thread = new Thread(() =>
            {
                _tracer.StartTrace();
                Thread.Sleep(69);
                MethodOne(13, new object());
                Thread.Sleep(50);
                MethodFive(12);
                _tracer.StopTrace();
                _tracer.StartTrace();
                Thread.Sleep(100);
                _tracer.StopTrace();
                Tracer.XmlTraceResultFormatter xmlTraceResultFormatter = new XmlTraceResultFormatter("testXML.xml");
                xmlTraceResultFormatter.Format(_tracer.GetTraceResult());
                Tracer.ConsoleTraceResultFormatter consoleTraceResultFormatter = new ConsoleTraceResultFormatter();

                consoleTraceResultFormatter.Format(_tracer.GetTraceResult());
            });

            thread.Start();
            Console.ReadLine();
        }