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
This commit is contained in:
parent
33dad0d59c
commit
aa68b683e5
|
@ -1,23 +1,24 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
public class Example
|
public class Example
|
||||||
{
|
{
|
||||||
efl.model.Item root, child2;
|
static efl.IModel_Item root, child2;
|
||||||
|
|
||||||
// Create our test hierarchy
|
// Create our test hierarchy
|
||||||
static void ObjCreate()
|
static void ObjCreate()
|
||||||
{
|
{
|
||||||
// First create a root element
|
// 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");
|
eroot.SetName("Root");
|
||||||
});
|
});
|
||||||
|
|
||||||
// Create the first child element
|
// 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");
|
eroot.SetName("Child1");
|
||||||
});
|
});
|
||||||
|
|
||||||
// Create the second child element, this time, with an extra reference
|
// 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");
|
eroot.SetName("Child2");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -26,12 +27,11 @@ public class Example
|
||||||
static void ObjDestroy()
|
static void ObjDestroy()
|
||||||
{
|
{
|
||||||
// Destroy the root element
|
// Destroy the root element
|
||||||
printf ("Deleting Root...\n");
|
Console.WriteLine ("Deleting Root...\n");
|
||||||
efl_unref(root);
|
|
||||||
root.Dispose();
|
root.Dispose();
|
||||||
|
|
||||||
// Destroy the child2 element, for which we were keeping an extra reference
|
// Destroy the child2 element, for which we were keeping an extra reference
|
||||||
printf ("Deleting Child2...\n");
|
Console.WriteLine ("Deleting Child2...\n");
|
||||||
child2.Dispose();
|
child2.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,4 +47,4 @@ public class Example
|
||||||
|
|
||||||
efl.All.Shutdown();
|
efl.All.Shutdown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue