[Tizen] Add OnPreCreate and change OnPause OnResume to virtual function 02/142002/2
authorminho.sun <minho.sun@samsung.com>
Wed, 2 Aug 2017 07:34:55 +0000 (16:34 +0900)
committerminho.sun <minho.sun@samsung.com>
Wed, 2 Aug 2017 08:09:49 +0000 (17:09 +0900)
Add OnPreCreate function to NUIApplication
And change OnPause OnResume function to virtual function

Change-Id: I8b2b38acd35bdf9c22fefb9dd5ee1da43afa9b63

Tizen.NUI/Tizen.NUI.csproj
Tizen.NUI/src/internal/NUICoreBackend.cs
Tizen.NUI/src/public/NUIApplication.cs
packaging/csapi-nui.spec

index 1ae98bb..ea4d092 100755 (executable)
@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">\r
 \r
   <PropertyGroup>\r
-    <Version>0.2.49</Version>\r
+    <Version>0.2.50</Version>\r
     <Authors>Samsung Electronics</Authors>\r
     <Copyright>© Samsung Electronics Co., Ltd All Rights Reserved</Copyright>\r
     <Description>\r
@@ -25,7 +25,7 @@
 \r
   <ItemGroup>\r
     <PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" PrivateAssets="All" />\r
-    <PackageReference Include="Tizen.Applications.Common" Version="1.5.8" />\r
+    <PackageReference Include="Tizen.Applications.Common" Version="1.5.9" />\r
     <PackageReference Include="Tizen.System.SystemSettings" Version="1.0.4" PrivateAssets="All"/>\r
   </ItemGroup>\r
   <Target Name="ChangeAliasesOfStrongNameAssemblies" BeforeTargets="FindReferenceAssembliesForReferences;ResolveReferences">\r
index 20dff95..efa71e0 100755 (executable)
@@ -179,9 +179,13 @@ namespace Tizen.NUI
         /// <param name="e">Event argument for Initialized</param>
         private void OnInitialized(object source, NUIApplicationInitEventArgs e)
         {
-            Log.Debug("NUI", "NUICorebackend OnInitialized Called");
-            var handler = Handlers[EventType.Created] as Action;
-            handler?.Invoke();
+            Log.Debug("NUI", "NUICorebackend OnPreCreated Called");
+            var preCreateHandler = Handlers[EventType.PreCreated] as Action;
+            preCreateHandler?.Invoke();
+
+            Log.Debug("NUI", "NUICorebackend OnCreate Called");
+            var createHandler = Handlers[EventType.Created] as Action;
+            createHandler?.Invoke();
         }
 
         /// <summary>
index 2221036..3f7823d 100755 (executable)
@@ -95,16 +95,22 @@ namespace Tizen.NUI
         /// <summary>
         /// Overrides this method if want to handle behavior.
         /// </summary>
-        protected void OnPause()
+        protected virtual void OnPause()
         {
         }
 
         /// <summary>
         /// Overrides this method if want to handle behavior.
         /// </summary>
-        protected void OnResume()
+        protected virtual void OnResume()
+        {
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior.
+        /// </summary>
+        protected virtual void OnPreCreate()
         {
-            Log.Debug("NUI", "OnResume() is called!");
         }
 
         /// <summary>
@@ -150,15 +156,16 @@ namespace Tizen.NUI
             }
             argsClone[0] = string.Empty;
 
-            Backend.AddEventHandler(EventType.Resumed, OnResume);
+            Backend.AddEventHandler(EventType.PreCreated, OnPreCreate);
+            Backend.AddEventHandler(EventType.Created, OnCreate);
             Backend.AddEventHandler<AppControlReceivedEventArgs>(EventType.AppControlReceived, OnAppControlReceived);
+            Backend.AddEventHandler(EventType.Resumed, OnResume);
             Backend.AddEventHandler(EventType.Paused, OnPause);
             Backend.AddEventHandler(EventType.Terminated, OnTerminate);
             Backend.AddEventHandler<RegionFormatChangedEventArgs>(EventType.RegionFormatChanged, OnRegionFormatChanged);
             Backend.AddEventHandler<LowMemoryEventArgs>(EventType.LowMemory, OnLowMemory);
             Backend.AddEventHandler<LowBatteryEventArgs>(EventType.LowBattery, OnLowBattery);
             Backend.AddEventHandler<LocaleChangedEventArgs>(EventType.LocaleChanged, OnLocaleChanged);
-            Backend.AddEventHandler(EventType.Created, OnCreate);
 
             Backend.Run(argsClone);
         }
index ebde663..368060b 100755 (executable)
@@ -1,8 +1,7 @@
 Name:       csapi-nui
 Summary:    dali-NUI
-Version:    0.2.48.pre1
+Version:    0.2.50
 Release:    1
-Group:      Development/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT
 URL:        https://www.tizen.org
 Source0:    %{name}-%{version}.tar.gz