vitorsousa pushed a commit to branch master.

http://git.enlightenment.org/tools/examples.git/commit/?id=e989e18864af37cb05b733d29d803070f36eed22

commit e989e18864af37cb05b733d29d803070f36eed22
Author: Vitor Sousa <[email protected]>
Date:   Mon Feb 26 14:09:07 2018 -0300

    eo_mono: add eo-intro tutorial for C#
---
 tutorial/csharp/eo-intro/meson.build          | 10 ++++++
 tutorial/csharp/eo-intro/src/eo_intro_main.cs | 50 +++++++++++++++++++++++++++
 tutorial/csharp/eo-intro/src/meson.build      | 12 +++++++
 3 files changed, 72 insertions(+)

diff --git a/tutorial/csharp/eo-intro/meson.build 
b/tutorial/csharp/eo-intro/meson.build
new file mode 100644
index 0000000..6177eb5
--- /dev/null
+++ b/tutorial/csharp/eo-intro/meson.build
@@ -0,0 +1,10 @@
+project(
+  'efl-example-eo-intro', 'cs',
+  version : '0.0.1',
+  meson_version : '>= 0.38.0')
+
+efl_mono = dependency('efl-mono', version : '>=1.20.99')
+efl_mono_libs = efl_mono.get_pkgconfig_variable('mono_libs')
+
+subdir('src')
+
diff --git a/tutorial/csharp/eo-intro/src/eo_intro_main.cs 
b/tutorial/csharp/eo-intro/src/eo_intro_main.cs
new file mode 100644
index 0000000..fc5e68e
--- /dev/null
+++ b/tutorial/csharp/eo-intro/src/eo_intro_main.cs
@@ -0,0 +1,50 @@
+
+public class Example
+{
+    efl.model.Item root, child2;
+
+    // Create our test hierarchy
+    static void ObjCreate()
+    {
+        // First create a root element
+        root = new efl.model.Item(null, (efl.model.Item eroot) => {
+            eroot.SetName("Root");
+        });
+
+        // Create the first child element
+        new efl.model.Item(root, (efl.model.Item eroot) => {
+            eroot.SetName("Child1");
+        });
+
+        // Create the second child element, this time, with an extra reference
+        child2 = new efl.model.Item(root, (efl.model.Item eroot) => {
+            eroot.SetName("Child2");
+        });
+    }
+
+    // Destroy the test hierarchy
+    static void ObjDestroy()
+    {
+        // Destroy the root element
+        printf ("Deleting Root...\n");
+        efl_unref(root);
+        root.Dispose();
+
+        // Destroy the child2 element, for which we were keeping an extra 
reference
+        printf ("Deleting Child2...\n");
+        child2.Dispose();
+    }
+
+    public static void Main()
+    {
+        efl.All.Init(efl.Components.Ui);
+
+        // Create all objects
+        ObjCreate();
+
+        // Destroy all objects
+        ObjDestroy();
+
+        efl.All.Shutdown();
+    }
+}
\ No newline at end of file
diff --git a/tutorial/csharp/eo-intro/src/meson.build 
b/tutorial/csharp/eo-intro/src/meson.build
new file mode 100644
index 0000000..10b14e1
--- /dev/null
+++ b/tutorial/csharp/eo-intro/src/meson.build
@@ -0,0 +1,12 @@
+src = files([
+  'eo_intro_main.cs',
+])
+
+deps = [efl_mono]
+
+executable('efl_example_eo_intro', src,
+  dependencies : deps,
+  cs_args : efl_mono_libs,
+  install : true
+)
+

-- 


Reply via email to