summaryrefslogtreecommitdiff
path: root/reference/csharp/core/src/core_event.cs
diff options
context:
space:
mode:
Diffstat (limited to 'reference/csharp/core/src/core_event.cs')
-rw-r--r--reference/csharp/core/src/core_event.cs48
1 files changed, 24 insertions, 24 deletions
diff --git a/reference/csharp/core/src/core_event.cs b/reference/csharp/core/src/core_event.cs
index 20f38b7..2cb6d8e 100644
--- a/reference/csharp/core/src/core_event.cs
+++ b/reference/csharp/core/src/core_event.cs
@@ -31,33 +31,33 @@ public class Example
31 mainloop.PollHighEvt += PollCb; 31 mainloop.PollHighEvt += PollCb;
32 32
33 // This timer will control events fired by the main loop 33 // This timer will control events fired by the main loop
34 new Efl.LoopTimer(mainloop, (Efl.LoopTimer etimer) => { 34 var timer = new Efl.LoopTimer(mainloop, (Efl.LoopTimer etimer) => {
35 etimer.SetName("Timer");
36 // Trigger every 100ms 35 // Trigger every 100ms
37 etimer.SetInterval(0.1); 36 etimer.SetInterval(0.1);
38 // To count number of timer triggers
39 int tick_count = 0;
40 etimer.TickEvt += (object sender, EventArgs e) => {
41 string message = "Tick {0} from {1}: ";
42 // Depending on the number of timer ticks, it does a different thing
43 switch (tick_count) {
44 case 0:
45 message += "Freezing Mainloop events";
46 mainloop.FreezeEvent();
47 break;
48 case 1:
49 message += "Thawing Mainloop events";
50 mainloop.ThawEvent();
51 break;
52 default:
53 message += "Quitting";
54 mainloop.Quit(new Eina.Value(0));
55 break;
56 }
57 Console.WriteLine(message, tick_count, ((Efl.Object)sender).GetName());
58 tick_count++;
59 };
60 }); 37 });
38 timer.SetName("Timer");
39 // To count number of timer triggers
40 int tick_count = 0;
41 timer.TickEvt += (object sender, EventArgs e) => {
42 string message = "Tick {0} from {1}: ";
43 // Depending on the number of timer ticks, it does a different thing
44 switch (tick_count) {
45 case 0:
46 message += "Freezing Mainloop events";
47 mainloop.FreezeEvent();
48 break;
49 case 1:
50 message += "Thawing Mainloop events";
51 mainloop.ThawEvent();
52 break;
53 default:
54 message += "Quitting";
55 mainloop.Quit(new Eina.Value(0));
56 break;
57 }
58 Console.WriteLine(message, tick_count, ((Efl.Object)sender).GetName());
59 tick_count++;
60 };
61 61
62 Console.WriteLine("Waiting for Timer to call back..."); 62 Console.WriteLine("Waiting for Timer to call back...");
63 63