comparison MonoPlay/Program.cs @ 94:a43745f81f10 v2

minor fixes
author cin
date Thu, 23 Oct 2014 17:50:09 +0400
parents dc4942d09e74
children b3f5bc613905
comparison
equal deleted inserted replaced
93:dc4942d09e74 94:a43745f81f10
4 using Implab; 4 using Implab;
5 5
6 namespace MonoPlay { 6 namespace MonoPlay {
7 class MainClass { 7 class MainClass {
8 public static void Main(string[] args) { 8 public static void Main(string[] args) {
9 if (args == null)
10 throw new ArgumentNullException("args");
11
9 var listener = new ConsoleTraceListener(true); 12 var listener = new ConsoleTraceListener(true);
10 listener.Subscribe<TraceEvent>(); 13 listener.Subscribe<TraceEvent>();
11 14
12 MTComponentContainer.AppContainer.Add(listener); 15 MTComponentContainer.AppContainer.Add(listener);
13 16
14 TraceLog.StartLogicalOperation("program"); 17 TraceLog.StartLogicalOperation("program");
15 18
16 Console.WriteLine("Hello World!");
17
18 TraceLog.StartLogicalOperation("async"); 19 TraceLog.StartLogicalOperation("async");
19 AsyncPool.Invoke(() => { 20 AsyncPool.Invoke(() => {
20 TraceLog.TraceInformation("Hello async"); 21 TraceLog.TraceInformation("Hello async");
21 TraceLog.StartLogicalOperation(); 22 TraceLog.StartLogicalOperation("foo");
22 return 0; 23 return 0;
23 }) 24 })
24 .EndLogicalOperation() 25 .EndLogicalOperation()
25 .Join(); 26 .Join();
26 27