2018-07-04 05:24:33 -07:00
|
|
|
using System;
|
2018-02-26 09:09:07 -08:00
|
|
|
|
|
|
|
public class Example
|
|
|
|
{
|
2018-11-06 01:39:14 -08:00
|
|
|
static Efl.ModelItem root, child2;
|
2018-02-26 09:09:07 -08:00
|
|
|
|
|
|
|
// Create our test hierarchy
|
|
|
|
static void ObjCreate()
|
|
|
|
{
|
|
|
|
// First create a root element
|
2018-11-06 01:39:14 -08:00
|
|
|
root = new Efl.ModelItem(null, (Efl.ModelItem eroot) => {
|
2018-02-26 09:09:07 -08:00
|
|
|
eroot.SetName("Root");
|
|
|
|
});
|
|
|
|
|
|
|
|
// Create the first child element
|
2018-11-06 01:39:14 -08:00
|
|
|
new Efl.ModelItem(root, (Efl.ModelItem eroot) => {
|
2018-02-26 09:09:07 -08:00
|
|
|
eroot.SetName("Child1");
|
|
|
|
});
|
|
|
|
|
|
|
|
// Create the second child element, this time, with an extra reference
|
2018-11-06 01:39:14 -08:00
|
|
|
child2 = new Efl.ModelItem(root, (Efl.ModelItem eroot) => {
|
2018-02-26 09:09:07 -08:00
|
|
|
eroot.SetName("Child2");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// Destroy the test hierarchy
|
|
|
|
static void ObjDestroy()
|
|
|
|
{
|
|
|
|
// Destroy the root element
|
2018-07-04 05:24:33 -07:00
|
|
|
Console.WriteLine ("Deleting Root...\n");
|
2018-02-26 09:09:07 -08:00
|
|
|
root.Dispose();
|
|
|
|
|
|
|
|
// Destroy the child2 element, for which we were keeping an extra reference
|
2018-07-04 05:24:33 -07:00
|
|
|
Console.WriteLine ("Deleting Child2...\n");
|
2018-02-26 09:09:07 -08:00
|
|
|
child2.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void Main()
|
|
|
|
{
|
2018-11-06 01:39:14 -08:00
|
|
|
Efl.All.Init(Efl.Components.Ui);
|
2018-02-26 09:09:07 -08:00
|
|
|
|
|
|
|
// Create all objects
|
|
|
|
ObjCreate();
|
|
|
|
|
|
|
|
// Destroy all objects
|
|
|
|
ObjDestroy();
|
|
|
|
|
2018-11-06 01:39:14 -08:00
|
|
|
Efl.All.Shutdown();
|
2018-02-26 09:09:07 -08:00
|
|
|
}
|
2018-07-04 05:24:33 -07:00
|
|
|
}
|