2 using System.Collections.Generic;
4 using System.Reflection;
6 using System.Threading.Tasks;
7 using Tizen.NUI.BaseComponents;
9 namespace Tizen.NUI.Samples
11 public class DaliDemo : NUIApplication
13 public DaliDemo(string styleSheet) : base(styleSheet)
17 private IExample curExample = null;
21 global::System.GC.Collect();
22 global::System.GC.WaitForPendingFinalizers();
23 global::System.GC.Collect();
26 private void DeleteDaliDemo()
28 Window.Instance.Remove(demo.mRootActor);
29 demo.mRootActor.Dispose();
35 private void CreateDaliDemo()
37 demo = new DaliTableView((string name) =>
39 string fileName = global::System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
41 //global::System.Diagnostics.Process.Start(fileName, name);
46 Assembly assembly = this.GetType().Assembly;
48 Type exampleType = assembly.GetType("Tizen.NUI.Samples.IExample");
50 foreach (Type type in assembly.GetTypes())
52 if (exampleType.IsAssignableFrom(type) && type.Name != "SampleMain" && this.GetType() != type && true == type.IsClass)
54 demo.AddExample(new Example(type.FullName, type.Name));
58 demo.SortAlphabetically(true);
62 Window.Instance.GetDefaultLayer().Add(demo.mRootActor);
65 private void RunSample(string name)
67 Assembly assembly = typeof(DaliDemo).Assembly;
69 Type exampleType = assembly?.GetType(name);
70 IExample example = assembly?.CreateInstance(name) as IExample;
82 private void ExitSample()
84 curExample?.Deactivate();
92 protected override void OnCreate()
97 Window.Instance.KeyEvent += Instance_KeyEvent;
98 Window.Instance.BackgroundColor = Color.White;
101 private void Instance_KeyEvent(object sender, Window.KeyEventArgs e)
103 if (e.Key.State == Key.StateType.Up)
105 if (e.Key.KeyPressedName == "Escape" || e.Key.KeyPressedName == "XF86Back" || e.Key.KeyPressedName == "BackSpace")
107 if (null != curExample)
119 public void Deactivate()
124 private DaliTableView demo;