From: xb.teng Date: Thu, 13 Oct 2016 09:40:07 +0000 (+0800) Subject: Update the refined dali c# application to support more argument options X-Git-Tag: dali_1.2.12~11^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=a5504074d4a2bcbe70c1c27289ee9bc47106a270;ds=sidebyside Update the refined dali c# application to support more argument options Change-Id: I031bb3ce4c12aecb2a8e0a26f1c080b9e37bce7d --- diff --git a/plugins/dali-swig/examples/hello-test.cs b/plugins/dali-swig/examples/hello-test.cs old mode 100755 new mode 100644 index 61726aa..1f7962d --- a/plugins/dali-swig/examples/hello-test.cs +++ b/plugins/dali-swig/examples/hello-test.cs @@ -52,6 +52,14 @@ namespace MyCSharpExample { } + public Example(string stylesheet):base(stylesheet) + { + } + + public Example(string stylesheet, Dali.Application.WINDOW_MODE windowMode):base(stylesheet, windowMode) + { + } + private void Initialize() { // Connect the signal callback for stage touched signal @@ -111,7 +119,9 @@ namespace MyCSharpExample static void Main(string[] args) { Console.WriteLine("Hello mono world."); - Example example = new Example(); + //Example example = new Example(); + //Example example = new Example("stylesheet"); + Example example = new Example("stylesheet", Dali.Application.WINDOW_MODE.TRANSPARENT); example.Run(args); } } diff --git a/plugins/dali-swig/manual/csharp/Tizen.Applications/DaliApplication.cs b/plugins/dali-swig/manual/csharp/Tizen.Applications/DaliApplication.cs old mode 100755 new mode 100644 index 06d7756..6791355 --- a/plugins/dali-swig/manual/csharp/Tizen.Applications/DaliApplication.cs +++ b/plugins/dali-swig/manual/csharp/Tizen.Applications/DaliApplication.cs @@ -28,13 +28,61 @@ namespace Tizen.Applications /// This application is created before OnCreate() or created event. And the DaliApplication will be terminated when this application is closed. /// protected Dali.Application application; + + /// + /// The instance of the Dali Application extension. + /// protected Dali.ApplicationExtensions applicationExt; /// + /// Store the stylesheet value. + /// + protected string m_stylesheet; + + /// + /// Store the window mode value. + /// + protected Dali.Application.WINDOW_MODE m_windowMode; + + /// + /// Store the app mode value. + /// + protected APP_MODE appMode; + + /// /// The instance of the Dali Stage. /// public Stage stage { get; private set; } + /// + /// The default constructor. + /// + public DaliApplication():base() + { + appMode = APP_MODE.DEFAULT; + } + + /// + /// The constructor with stylesheet. + /// + public DaliApplication(string stylesheet):base() + { + //handle the stylesheet + appMode = APP_MODE.STYLESHEETONLY; + m_stylesheet = stylesheet; + } + + /// + /// The constructor with stylesheet and window mode. + /// + public DaliApplication(string stylesheet, Dali.Application.WINDOW_MODE windowMode) + : base() + { + //handle the stylesheet and windowMode + appMode = APP_MODE.STYLESHEETWITHWINDOWMODE; + m_stylesheet = stylesheet; + m_windowMode = windowMode; + } /// /// Overrides this method if want to handle behavior before calling OnCreate(). @@ -42,8 +90,22 @@ namespace Tizen.Applications /// protected override void OnPreCreate() { - application = Dali.Application.NewApplication(); - applicationExt = new Dali::ApplicationExtensions(application); + switch(appMode) + { + case APP_MODE.DEFAULT: + application = Dali.Application.NewApplication(); + break; + case APP_MODE.STYLESHEETONLY: + application = Dali.Application.NewApplication(m_stylesheet); + break; + case APP_MODE.STYLESHEETWITHWINDOWMODE: + application = Dali.Application.NewApplication(m_stylesheet, m_windowMode); + break; + default: + break; + } + + applicationExt = new Dali.ApplicationExtensions(application); applicationExt.Init(); stage = Stage.GetCurrent(); @@ -85,5 +147,15 @@ namespace Tizen.Applications base.OnLocaleChanged(e); applicationExt.LanguageChange(); } + + /// + /// The mode of creating Dali application. + /// + protected enum APP_MODE + { + DEFAULT = 0, + STYLESHEETONLY = 1, + STYLESHEETWITHWINDOWMODE = 2 + } } }