annotate MonoPlay/Program.cs @ 102:b4c4d65b7def v2

code cleaunp
author cin
date Fri, 07 Nov 2014 09:36:12 +0300
parents a43745f81f10
children b3f5bc613905
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) {
94
a43745f81f10 minor fixes
cin
parents: 93
diff changeset
9 if (args == null)
a43745f81f10 minor fixes
cin
parents: 93
diff changeset
10 throw new ArgumentNullException("args");
a43745f81f10 minor fixes
cin
parents: 93
diff changeset
11
93
dc4942d09e74 improved tracing
cin
parents:
diff changeset
12 var listener = new ConsoleTraceListener(true);
dc4942d09e74 improved tracing
cin
parents:
diff changeset
13 listener.Subscribe<TraceEvent>();
dc4942d09e74 improved tracing
cin
parents:
diff changeset
14
dc4942d09e74 improved tracing
cin
parents:
diff changeset
15 MTComponentContainer.AppContainer.Add(listener);
dc4942d09e74 improved tracing
cin
parents:
diff changeset
16
dc4942d09e74 improved tracing
cin
parents:
diff changeset
17 TraceLog.StartLogicalOperation("program");
dc4942d09e74 improved tracing
cin
parents:
diff changeset
18
dc4942d09e74 improved tracing
cin
parents:
diff changeset
19 TraceLog.StartLogicalOperation("async");
dc4942d09e74 improved tracing
cin
parents:
diff changeset
20 AsyncPool.Invoke(() => {
dc4942d09e74 improved tracing
cin
parents:
diff changeset
21 TraceLog.TraceInformation("Hello async");
94
a43745f81f10 minor fixes
cin
parents: 93
diff changeset
22 TraceLog.StartLogicalOperation("foo");
93
dc4942d09e74 improved tracing
cin
parents:
diff changeset
23 return 0;
dc4942d09e74 improved tracing
cin
parents:
diff changeset
24 })
dc4942d09e74 improved tracing
cin
parents:
diff changeset
25 .EndLogicalOperation()
dc4942d09e74 improved tracing
cin
parents:
diff changeset
26 .Join();
dc4942d09e74 improved tracing
cin
parents:
diff changeset
27
dc4942d09e74 improved tracing
cin
parents:
diff changeset
28 TraceLog.EndLogicalOperation();
dc4942d09e74 improved tracing
cin
parents:
diff changeset
29
dc4942d09e74 improved tracing
cin
parents:
diff changeset
30 }
dc4942d09e74 improved tracing
cin
parents:
diff changeset
31 }
dc4942d09e74 improved tracing
cin
parents:
diff changeset
32 }