Update the refined dali c# application to support more argument options 25/92125/1
authorxb.teng <xb.teng@samsung.com>
Thu, 13 Oct 2016 09:40:07 +0000 (17:40 +0800)
committerxb.teng <xb.teng@samsung.com>
Thu, 13 Oct 2016 09:40:07 +0000 (17:40 +0800)
Change-Id: I031bb3ce4c12aecb2a8e0a26f1c080b9e37bce7d

plugins/dali-swig/examples/hello-test.cs [changed mode: 0755->0644]
plugins/dali-swig/manual/csharp/Tizen.Applications/DaliApplication.cs [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 61726aa..1f7962d
@@ -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
         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.");
         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);
         }
     }
             example.Run(args);
         }
     }
old mode 100755 (executable)
new mode 100644 (file)
index 06d7756..6791355
@@ -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.
         /// </remarks>
         protected Dali.Application application;
         /// This application is created before OnCreate() or created event. And the DaliApplication will be terminated when this application is closed.
         /// </remarks>
         protected Dali.Application application;
+
+        /// <summary>
+        /// The instance of the Dali Application extension.
+        /// </summary>
         protected Dali.ApplicationExtensions applicationExt;
 
         /// <summary>
         protected Dali.ApplicationExtensions applicationExt;
 
         /// <summary>
+        /// Store the stylesheet value.
+        /// </summary>
+        protected string m_stylesheet;
+
+        /// <summary>
+        /// Store the window mode value.
+        /// </summary>
+        protected Dali.Application.WINDOW_MODE m_windowMode;
+
+        /// <summary>
+        /// Store the app mode value.
+        /// </summary>
+        protected APP_MODE appMode;
+
+        /// <summary>
         /// The instance of the Dali Stage.
         /// </summary>
         public Stage stage { get; private set; }
 
         /// The instance of the Dali Stage.
         /// </summary>
         public Stage stage { get; private set; }
 
+        /// <summary>
+        /// The default constructor.
+        /// </summary>
+        public DaliApplication():base()
+        {
+            appMode = APP_MODE.DEFAULT;
+        }
+
+        /// <summary>
+        /// The constructor with stylesheet.
+        /// </summary>
+        public DaliApplication(string stylesheet):base()
+        {
+            //handle the stylesheet
+            appMode = APP_MODE.STYLESHEETONLY;
+            m_stylesheet = stylesheet;
+        }
+
+        /// <summary>
+        /// The constructor with stylesheet and window mode.
+        /// </summary>
+        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;
+        }
 
         /// <summary>
         /// Overrides this method if want to handle behavior before calling OnCreate().
 
         /// <summary>
         /// Overrides this method if want to handle behavior before calling OnCreate().
@@ -42,8 +90,22 @@ namespace Tizen.Applications
         /// </summary>
         protected override void OnPreCreate()
         {
         /// </summary>
         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();
             applicationExt.Init();
 
             stage = Stage.GetCurrent();
@@ -85,5 +147,15 @@ namespace Tizen.Applications
             base.OnLocaleChanged(e);
             applicationExt.LanguageChange();
         }
             base.OnLocaleChanged(e);
             applicationExt.LanguageChange();
         }
+
+        /// <summary>
+        /// The mode of creating Dali application.
+        /// </summary>
+        protected enum APP_MODE
+        {
+            DEFAULT = 0,
+            STYLESHEETONLY = 1,
+            STYLESHEETWITHWINDOWMODE = 2
+        }
     }
 }
     }
 }