summaryrefslogtreecommitdiff
path: root/reference/csharp/core
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2018-11-06 10:39:14 +0100
committerXavi Artigas <xavierartigas@yahoo.es>2018-12-19 16:51:15 +0100
commitd74a4df9946b69f769cd0ad40d4414c90d19a515 (patch)
tree7d4de6983ac9b319085fd84f559d2f592fc215b3 /reference/csharp/core
parent656b746be7ffb834a31d0a693071f9eebba186c6 (diff)
csharp examples: Adapt to new classes syntax
Summary: Mainly use PascalCase Namespaces and Classes and proper event names. Test Plan: Check all examples still build. Reviewers: lauromoura, vitor.sousa, felipealmeida, bu5hm4n Reviewed By: bu5hm4n Differential Revision: https://phab.enlightenment.org/D7479
Diffstat (limited to 'reference/csharp/core')
-rw-r--r--reference/csharp/core/src/core_event.cs14
-rw-r--r--reference/csharp/core/src/core_idler.cs10
-rw-r--r--reference/csharp/core/src/core_poll.cs10
3 files changed, 17 insertions, 17 deletions
diff --git a/reference/csharp/core/src/core_event.cs b/reference/csharp/core/src/core_event.cs
index 40bbb65..385357f 100644
--- a/reference/csharp/core/src/core_event.cs
+++ b/reference/csharp/core/src/core_event.cs
@@ -12,7 +12,7 @@ public class Example
12 // Polling callback 12 // Polling callback
13 private static void PollCb(object sender, EventArgs e) 13 private static void PollCb(object sender, EventArgs e)
14 { 14 {
15 Console.WriteLine(" Poll from {0}", ((efl.IObject)sender).GetName()); 15 Console.WriteLine(" Poll from {0}", ((Efl.Object)sender).GetName());
16 } 16 }
17 17
18#if WIN32 18#if WIN32
@@ -21,17 +21,17 @@ public class Example
21 public static void Main() 21 public static void Main()
22 { 22 {
23 // Initialize EFL and all UI components 23 // Initialize EFL and all UI components
24 efl.All.Init(); 24 Efl.All.Init();
25 25
26 // Retrieve the application's main loop 26 // Retrieve the application's main loop
27 var mainloop = efl.App.GetLoopMain(); 27 var mainloop = Efl.App.GetLoopMain();
28 mainloop.SetName("Mainloop"); 28 mainloop.SetName("Mainloop");
29 29
30 // This event gets triggered continuously 30 // This event gets triggered continuously
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.Loop_Timer(mainloop, (efl.ILoop_Timer etimer) => { 34 new Efl.LoopTimer(mainloop, (Efl.LoopTimer etimer) => {
35 etimer.SetName("Timer"); 35 etimer.SetName("Timer");
36 // Trigger every 100ms 36 // Trigger every 100ms
37 etimer.SetInterval(0.1); 37 etimer.SetInterval(0.1);
@@ -51,10 +51,10 @@ public class Example
51 break; 51 break;
52 default: 52 default:
53 message += "Quitting"; 53 message += "Quitting";
54 mainloop.Quit(new eina.Value(0)); 54 mainloop.Quit(new Eina.Value(0));
55 break; 55 break;
56 } 56 }
57 Console.WriteLine(message, tick_count, ((efl.IObject)sender).GetName()); 57 Console.WriteLine(message, tick_count, ((Efl.Object)sender).GetName());
58 tick_count++; 58 tick_count++;
59 }; 59 };
60 }); 60 });
@@ -65,7 +65,7 @@ public class Example
65 mainloop.Begin(); 65 mainloop.Begin();
66 66
67 // Shutdown EFL 67 // Shutdown EFL
68 efl.All.Shutdown(); 68 Efl.All.Shutdown();
69 69
70 Console.WriteLine("Application is over"); 70 Console.WriteLine("Application is over");
71 } 71 }
diff --git a/reference/csharp/core/src/core_idler.cs b/reference/csharp/core/src/core_idler.cs
index 3657d8f..c25b31f 100644
--- a/reference/csharp/core/src/core_idler.cs
+++ b/reference/csharp/core/src/core_idler.cs
@@ -17,10 +17,10 @@ public class Example
17 public static void Main() 17 public static void Main()
18 { 18 {
19 // Initialize EFL and all UI components 19 // Initialize EFL and all UI components
20 efl.All.Init(); 20 Efl.All.Init();
21 21
22 // Retrieve the application's main loop 22 // Retrieve the application's main loop
23 var mainloop = efl.App.GetLoopMain(); 23 var mainloop = Efl.App.GetLoopMain();
24 24
25 // Register to all Idle events 25 // Register to all Idle events
26 mainloop.IdleEnterEvt += (object sender, EventArgs e) => { 26 mainloop.IdleEnterEvt += (object sender, EventArgs e) => {
@@ -34,12 +34,12 @@ public class Example
34 }; 34 };
35 35
36 // Use a timer to exit the application 36 // Use a timer to exit the application
37 new efl.Loop_Timer(mainloop, (efl.ILoop_Timer etimer) => { 37 new Efl.LoopTimer(mainloop, (Efl.LoopTimer etimer) => {
38 // Trigger after 10ms 38 // Trigger after 10ms
39 etimer.SetInterval(0.01); 39 etimer.SetInterval(0.01);
40 etimer.TickEvt += (object sender, EventArgs e) => { 40 etimer.TickEvt += (object sender, EventArgs e) => {
41 Console.WriteLine("TIMER: timer callback called, exiting."); 41 Console.WriteLine("TIMER: timer callback called, exiting.");
42 mainloop.Quit(new eina.Value(0)); 42 mainloop.Quit(new Eina.Value(0));
43 }; 43 };
44 }); 44 });
45 45
@@ -47,6 +47,6 @@ public class Example
47 mainloop.Begin(); 47 mainloop.Begin();
48 48
49 // Shutdown EFL 49 // Shutdown EFL
50 efl.All.Shutdown(); 50 Efl.All.Shutdown();
51 } 51 }
52} 52}
diff --git a/reference/csharp/core/src/core_poll.cs b/reference/csharp/core/src/core_poll.cs
index a05e7b9..6caf5c3 100644
--- a/reference/csharp/core/src/core_poll.cs
+++ b/reference/csharp/core/src/core_poll.cs
@@ -16,10 +16,10 @@ public class Example
16 public static void Main() 16 public static void Main()
17 { 17 {
18 // Initialize EFL and all UI components 18 // Initialize EFL and all UI components
19 efl.All.Init(); 19 Efl.All.Init();
20 20
21 // Retrieve the application's main loop 21 // Retrieve the application's main loop
22 var mainloop = efl.App.GetLoopMain(); 22 var mainloop = Efl.App.GetLoopMain();
23 23
24 // Register to all Poll events 24 // Register to all Poll events
25 mainloop.PollLowEvt += (object sender, EventArgs e) => { 25 mainloop.PollLowEvt += (object sender, EventArgs e) => {
@@ -33,12 +33,12 @@ public class Example
33 }; 33 };
34 34
35 // Use a timer to exit the application 35 // Use a timer to exit the application
36 new efl.Loop_Timer(mainloop, (efl.ILoop_Timer etimer) => { 36 new Efl.LoopTimer(mainloop, (Efl.LoopTimer etimer) => {
37 // Trigger after 30s 37 // Trigger after 30s
38 etimer.SetInterval(30); 38 etimer.SetInterval(30);
39 etimer.TickEvt += (object sender, EventArgs e) => { 39 etimer.TickEvt += (object sender, EventArgs e) => {
40 Console.WriteLine("\nTIMER: timer callback called, exiting."); 40 Console.WriteLine("\nTIMER: timer callback called, exiting.");
41 mainloop.Quit(new eina.Value(0)); 41 mainloop.Quit(new Eina.Value(0));
42 }; 42 };
43 }); 43 });
44 44
@@ -46,6 +46,6 @@ public class Example
46 mainloop.Begin(); 46 mainloop.Begin();
47 47
48 // Shutdown EFL 48 // Shutdown EFL
49 efl.All.Shutdown(); 49 Efl.All.Shutdown();
50 } 50 }
51} 51}