1 // Copyright 2016 by Samsung Electronics, Inc.,
3 // This software is the confidential and proprietary information
4 // of Samsung Electronics, Inc. ("Confidential Information"). You
5 // shall not disclose such Confidential Information and shall use
6 // it only in accordance with the terms of the license agreement
7 // you entered into with Samsung.
11 //------------------------------------------------------------------------------
12 // <manual-generated />
14 // This file can only run on Tizen target. You should compile it with hello-test.cs, and
15 // add tizen c# application related library as reference.
16 //------------------------------------------------------------------------------
17 namespace Tizen.Applications
20 /// Represents an application that have UI screen. The DaliApplication class has a default stage.
22 public class DaliApplication : CoreUIApplication
25 /// The instance of the Dali Application.
28 /// This application is created before OnCreate() or created event. And the DaliApplication will be terminated when this application is closed.
30 protected Dali.Application application;
33 /// The instance of the Dali Application extension.
35 protected Dali.ApplicationExtensions applicationExt;
38 /// Store the stylesheet value.
40 protected string m_stylesheet;
43 /// Store the window mode value.
45 protected Dali.Application.WINDOW_MODE m_windowMode;
48 /// Store the app mode value.
50 protected APP_MODE appMode;
53 /// The instance of the Dali Stage.
55 public Stage stage { get; private set; }
58 /// The default constructor.
60 public DaliApplication():base()
62 appMode = APP_MODE.DEFAULT;
66 /// The constructor with stylesheet.
68 public DaliApplication(string stylesheet):base()
70 //handle the stylesheet
71 appMode = APP_MODE.STYLESHEETONLY;
72 m_stylesheet = stylesheet;
76 /// The constructor with stylesheet and window mode.
78 public DaliApplication(string stylesheet, Dali.Application.WINDOW_MODE windowMode)
81 //handle the stylesheet and windowMode
82 appMode = APP_MODE.STYLESHEETWITHWINDOWMODE;
83 m_stylesheet = stylesheet;
84 m_windowMode = windowMode;
88 /// Overrides this method if want to handle behavior before calling OnCreate().
89 /// stage property is initialized in this overrided method.
91 protected override void OnPreCreate()
95 case APP_MODE.DEFAULT:
96 application = Dali.Application.NewApplication();
98 case APP_MODE.STYLESHEETONLY:
99 application = Dali.Application.NewApplication(m_stylesheet);
101 case APP_MODE.STYLESHEETWITHWINDOWMODE:
102 application = Dali.Application.NewApplication(m_stylesheet, m_windowMode);
108 applicationExt = new Dali.ApplicationExtensions(application);
109 applicationExt.Init();
111 stage = Stage.GetCurrent();
112 stage.SetBackgroundColor( NDalic.WHITE );
116 /// Overrides this method if want to handle behavior.
118 protected override void OnTerminate()
121 applicationExt.Terminate();
125 /// Overrides this method if want to handle behavior.
127 protected override void OnPause()
130 applicationExt.Pause();
134 /// Overrides this method if want to handle behavior.
136 protected override void OnResume()
139 applicationExt.Resume();
143 /// Overrides this method if want to handle behavior.
145 protected override void OnLocaleChanged(LocaleChangedEventArgs e)
147 base.OnLocaleChanged(e);
148 applicationExt.LanguageChange();
152 /// The mode of creating Dali application.
154 protected enum APP_MODE
158 STYLESHEETWITHWINDOWMODE = 2