2018-07-04 05:24:33 -07:00
|
|
|
using System;
|
2018-02-26 09:09:07 -08:00
|
|
|
|
2019-03-26 04:19:13 -07:00
|
|
|
public class Example : Efl.Csharp.Application
|
2018-02-26 09:09:07 -08:00
|
|
|
{
|
2019-02-01 00:57:15 -08:00
|
|
|
static Efl.GenericModel root, child2;
|
2018-02-26 09:09:07 -08:00
|
|
|
|
|
|
|
// Create our test hierarchy
|
|
|
|
static void ObjCreate()
|
|
|
|
{
|
|
|
|
// First create a root element
|
2019-02-01 00:57:15 -08:00
|
|
|
root = new Efl.GenericModel(null);
|
2019-01-18 07:53:55 -08:00
|
|
|
root.SetName("Root");
|
2018-02-26 09:09:07 -08:00
|
|
|
|
|
|
|
// Create the first child element
|
2019-02-01 00:57:15 -08:00
|
|
|
var child = new Efl.GenericModel(root);
|
2019-01-18 07:53:55 -08:00
|
|
|
child.SetName("Child1");
|
2018-02-26 09:09:07 -08:00
|
|
|
|
|
|
|
// Create the second child element, this time, with an extra reference
|
2019-02-01 00:57:15 -08:00
|
|
|
child2 = new Efl.GenericModel(root);
|
2019-01-18 07:53:55 -08:00
|
|
|
child2.SetName("Child2");
|
2018-02-26 09:09:07 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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();
|
|
|
|
}
|
|
|
|
|
2019-06-28 15:46:12 -07:00
|
|
|
protected override void OnInitialize(string[] args)
|
2018-02-26 09:09:07 -08:00
|
|
|
{
|
|
|
|
// Create all objects
|
|
|
|
ObjCreate();
|
|
|
|
|
|
|
|
// Destroy all objects
|
|
|
|
ObjDestroy();
|
|
|
|
|
2019-03-26 04:19:13 -07:00
|
|
|
Efl.App.AppMain.Quit(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
#if WIN32
|
|
|
|
[STAThreadAttribute()]
|
|
|
|
#endif
|
|
|
|
public static void Main()
|
|
|
|
{
|
|
|
|
var example = new Example();
|
|
|
|
example.Launch();
|
2018-02-26 09:09:07 -08:00
|
|
|
}
|
2018-07-04 05:24:33 -07:00
|
|
|
}
|