examples/tutorial/csharp/eo-intro/src/eo_intro_main.cs

55 lines
1.3 KiB
C#
Raw Permalink Normal View History

using System;
2018-02-26 09:09:07 -08:00
public class Example : Efl.Csharp.Application
2018-02-26 09:09:07 -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
root = new Efl.GenericModel(null);
root.Name = "Root";
2018-02-26 09:09:07 -08:00
// Create the first child element
var child = new Efl.GenericModel(root);
child.Name = "Child1";
2018-02-26 09:09:07 -08:00
// Create the second child element, this time, with an extra reference
child2 = new Efl.GenericModel(root);
child2.Name = "Child2";
2018-02-26 09:09:07 -08:00
}
// Destroy the test hierarchy
static void ObjDestroy()
{
// Destroy the root element
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
Console.WriteLine ("Deleting Child2...\n");
2018-02-26 09:09:07 -08:00
child2.Dispose();
}
protected override void OnInitialize(string[] args)
2018-02-26 09:09:07 -08:00
{
// Create all objects
ObjCreate();
// Destroy all objects
ObjDestroy();
Efl.App.AppMain.Quit(0);
}
#if WIN32
[STAThreadAttribute()]
#endif
public static void Main()
{
var example = new Example();
example.Launch(Efl.Csharp.Components.Basic);
2018-02-26 09:09:07 -08:00
}
}