0
|
1 |
//! [0]
|
|
2 |
using System;
|
|
3 |
|
|
4 |
namespace WrapperApp
|
|
5 |
{
|
|
6 |
class App
|
|
7 |
{
|
|
8 |
void Run()
|
|
9 |
{
|
|
10 |
netWorker worker = new netWorker();
|
|
11 |
|
|
12 |
worker.statusStringChanged += new netWorker.__Delegate_statusStringChanged(onStatusStringChanged);
|
|
13 |
|
|
14 |
System.Console.Out.WriteLine(worker.StatusString);
|
|
15 |
|
|
16 |
System.Console.Out.WriteLine("Working cycle begins...");
|
|
17 |
worker.StatusString = "Working";
|
|
18 |
worker.StatusString = "Lunch Break";
|
|
19 |
worker.StatusString = "Working";
|
|
20 |
worker.StatusString = "Idle";
|
|
21 |
System.Console.Out.WriteLine("Working cycle ends...");
|
|
22 |
}
|
|
23 |
|
|
24 |
private void onStatusStringChanged(string str)
|
|
25 |
{
|
|
26 |
System.Console.Out.WriteLine(str);
|
|
27 |
}
|
|
28 |
|
|
29 |
[STAThread]
|
|
30 |
//! [0] //! [1]
|
|
31 |
static void Main(string[] args)
|
|
32 |
{
|
|
33 |
App app = new App();
|
|
34 |
app.Run();
|
|
35 |
}
|
|
36 |
//! [1] //! [2]
|
|
37 |
}
|
|
38 |
//! [2] //! [3]
|
|
39 |
}
|
|
40 |
//! [3]
|