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);
|
2020-02-20 08:09:22 -08:00
|
|
|
root.Name = "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);
|
2020-02-20 08:09:22 -08:00
|
|
|
child.Name = "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);
|
2020-02-20 08:09:22 -08:00
|
|
|
child2.Name = "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();
|
2019-09-12 06:01:45 -07:00
|
|
|
example.Launch(Efl.Csharp.Components.Basic);
|
2018-02-26 09:09:07 -08:00
|
|
|
}
|
2018-07-04 05:24:33 -07:00
|
|
|
}
|