summaryrefslogtreecommitdiff
path: root/tutorial/csharp/eo-intro
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2019-03-26 11:19:13 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-03-26 16:24:20 +0100
commitb55e5150c91dd860fe86588adce9e0bb35d60c5b (patch)
tree2b861f118b97910088db08dff7348447af0d99df /tutorial/csharp/eo-intro
parent871add6fe5794b4320f2918d1b17504f8e839230 (diff)
mono examples: Adapt to Efl.Csharp.Application
This class simplifies app development, so the examples have to showcase it. Basically: - Your app inherits form it - You do not need to init() or shutdown() - You override the methods you want (like OnInitialize). Fixes T7655 Differential Revision: https://phab.enlightenment.org/D8477
Diffstat (limited to 'tutorial/csharp/eo-intro')
-rw-r--r--tutorial/csharp/eo-intro/src/eo_intro_main.cs17
1 files changed, 12 insertions, 5 deletions
diff --git a/tutorial/csharp/eo-intro/src/eo_intro_main.cs b/tutorial/csharp/eo-intro/src/eo_intro_main.cs
index db9ce45..4aa8ac6 100644
--- a/tutorial/csharp/eo-intro/src/eo_intro_main.cs
+++ b/tutorial/csharp/eo-intro/src/eo_intro_main.cs
@@ -1,6 +1,6 @@
1using System; 1using System;
2 2
3public class Example 3public class Example : Efl.Csharp.Application
4{ 4{
5 static Efl.GenericModel root, child2; 5 static Efl.GenericModel root, child2;
6 6
@@ -32,16 +32,23 @@ public class Example
32 child2.Dispose(); 32 child2.Dispose();
33 } 33 }
34 34
35 public static void Main() 35 protected override void OnInitialize(Eina.Array<System.String> args)
36 { 36 {
37 Efl.All.Init(Efl.Components.Ui);
38
39 // Create all objects 37 // Create all objects
40 ObjCreate(); 38 ObjCreate();
41 39
42 // Destroy all objects 40 // Destroy all objects
43 ObjDestroy(); 41 ObjDestroy();
44 42
45 Efl.All.Shutdown(); 43 Efl.App.AppMain.Quit(0);
44 }
45
46#if WIN32
47 [STAThreadAttribute()]
48#endif
49 public static void Main()
50 {
51 var example = new Example();
52 example.Launch();
46 } 53 }
47} 54}