tutorials: Fix C# eo_intro

Summary: Adapt to API changes plus some other issues (has this ever built for anyone?).

Reviewers: lauromoura, felipealmeida

Differential Revision: https://phab.enlightenment.org/D6505
devs/lauromoura/fix-csharp-life
Xavi Artigas 4 years ago
parent 33dad0d59c
commit aa68b683e5
  1. 16
      tutorial/csharp/eo-intro/src/eo_intro_main.cs

@ -1,23 +1,24 @@
using System;
public class Example
{
efl.model.Item root, child2;
static efl.IModel_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) => {
root = new efl.Model_Item(null, (efl.IModel_Item eroot) => {
eroot.SetName("Root");
});
// Create the first child element
new efl.model.Item(root, (efl.model.Item eroot) => {
new efl.Model_Item(root, (efl.IModel_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) => {
child2 = new efl.Model_Item(root, (efl.IModel_Item eroot) => {
eroot.SetName("Child2");
});
}
@ -26,12 +27,11 @@ public class Example
static void ObjDestroy()
{
// Destroy the root element
printf ("Deleting Root...\n");
efl_unref(root);
Console.WriteLine ("Deleting Root...\n");
root.Dispose();
// Destroy the child2 element, for which we were keeping an extra reference
printf ("Deleting Child2...\n");
Console.WriteLine ("Deleting Child2...\n");
child2.Dispose();
}
@ -47,4 +47,4 @@ public class Example
efl.All.Shutdown();
}
}
}

Loading…
Cancel
Save