annotate MonoPlay/Program.cs @ 93:dc4942d09e74 v2

improved tracing added the application components container MTComponentContainer.AppContainer
author cin
date Thu, 23 Oct 2014 01:13:57 +0400
parents
children a43745f81f10
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
93
dc4942d09e74 improved tracing
cin
parents:
diff changeset
1 using System;
dc4942d09e74 improved tracing
cin
parents:
diff changeset
2 using Implab.Diagnostics;
dc4942d09e74 improved tracing
cin
parents:
diff changeset
3 using Implab.Parallels;
dc4942d09e74 improved tracing
cin
parents:
diff changeset
4 using Implab;
dc4942d09e74 improved tracing
cin
parents:
diff changeset
5
dc4942d09e74 improved tracing
cin
parents:
diff changeset
6 namespace MonoPlay {
dc4942d09e74 improved tracing
cin
parents:
diff changeset
7 class MainClass {
dc4942d09e74 improved tracing
cin
parents:
diff changeset
8 public static void Main(string[] args) {
dc4942d09e74 improved tracing
cin
parents:
diff changeset
9 var listener = new ConsoleTraceListener(true);
dc4942d09e74 improved tracing
cin
parents:
diff changeset
10 listener.Subscribe<TraceEvent>();
dc4942d09e74 improved tracing
cin
parents:
diff changeset
11
dc4942d09e74 improved tracing
cin
parents:
diff changeset
12 MTComponentContainer.AppContainer.Add(listener);
dc4942d09e74 improved tracing
cin
parents:
diff changeset
13
dc4942d09e74 improved tracing
cin
parents:
diff changeset
14 TraceLog.StartLogicalOperation("program");
dc4942d09e74 improved tracing
cin
parents:
diff changeset
15
dc4942d09e74 improved tracing
cin
parents:
diff changeset
16 Console.WriteLine("Hello World!");
dc4942d09e74 improved tracing
cin
parents:
diff changeset
17
dc4942d09e74 improved tracing
cin
parents:
diff changeset
18 TraceLog.StartLogicalOperation("async");
dc4942d09e74 improved tracing
cin
parents:
diff changeset
19 AsyncPool.Invoke(() => {
dc4942d09e74 improved tracing
cin
parents:
diff changeset
20 TraceLog.TraceInformation("Hello async");
dc4942d09e74 improved tracing
cin
parents:
diff changeset
21 TraceLog.StartLogicalOperation();
dc4942d09e74 improved tracing
cin
parents:
diff changeset
22 return 0;
dc4942d09e74 improved tracing
cin
parents:
diff changeset
23 })
dc4942d09e74 improved tracing
cin
parents:
diff changeset
24 .EndLogicalOperation()
dc4942d09e74 improved tracing
cin
parents:
diff changeset
25 .Join();
dc4942d09e74 improved tracing
cin
parents:
diff changeset
26
dc4942d09e74 improved tracing
cin
parents:
diff changeset
27 TraceLog.EndLogicalOperation();
dc4942d09e74 improved tracing
cin
parents:
diff changeset
28
dc4942d09e74 improved tracing
cin
parents:
diff changeset
29 }
dc4942d09e74 improved tracing
cin
parents:
diff changeset
30 }
dc4942d09e74 improved tracing
cin
parents:
diff changeset
31 }