コード例 #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();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            InitializeFormattersDictionary();
            ITraceResultFormatter formatter;

            try
            {
                formatter = formatters[args[0]];
            }
            catch (Exception)
            {
                formatter = new ConsoleTraceResultFormatter();
            }

            InitializeMethods();

            tracer.StartTrace();
            StartThreads();

            SomeTestMethod5();
            Thread.Sleep(GetRandomTimeInMilliseconds());

            StopThreads();
            tracer.StopTrace();

            TraceResult traceResult = tracer.GetTraceResult();

            formatter.Format(traceResult);

            SayGoodBye();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: SilantiFross/MPP.Tracer
        private static void OutputInfo()
        {
            var xmlFormatter     = new XmlTraceResultFormatter("TraceResult.xml");
            var consoleFormatter = new ConsoleTraceResultFormatter();

            consoleFormatter.Format(Tracer.GetTraceResult());
            xmlFormatter.Format(Tracer.GetTraceResult());
        }
コード例 #4
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();
        }