Merge preloading features
authorJoonghyunCho <chojoong@gmail.com>
Thu, 30 Jan 2020 08:25:11 +0000 (17:25 +0900)
committer이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com>
Wed, 26 Feb 2020 01:10:36 +0000 (10:10 +0900)
Change-Id: Ic9940d01248312d88956c05c6a59736c7dca84c4

Managed/Tizen.Init/Tizen.Init.cs

index fba9bc9..a86440c 100644 (file)
@@ -154,7 +154,7 @@ namespace Tizen.Init {
                 }
             }
 
-            PreloadLibICU();
+            PreloadLibICU();\r
             PreloadTizenFX();
 
             PreloadEnd();
@@ -201,55 +201,21 @@ namespace Tizen.Init {
 
         static void PreloadTizenFX()\r
         {\r
-            PreloadElmSharp();
-            PreloadSystemInfo();
-            PreloadTizenSynchronizationContext();\r
-        }
-
-        static void PreloadElmSharp()\r
-        {\r
             try
             {
                 Assembly assem = LoadAssembly("ElmSharp");
-                var type = assem.GetType("ElmSharp.Window");
-                type.GetMethod("Preload", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, null);
+                var type = assem.GetType("ElmSharp.Window");\r
+                type.GetMethod("Preload", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, null);\r
+\r
+                assem = LoadAssembly("Tizen.System.Information");
+                type = assem.GetType("Tizen.System.Information");
+                type.GetMethod("TryGetValue", BindingFlags.Public | BindingFlags.Static).MakeGenericMethod(typeof(int)).Invoke(null, new object[] { "http://tizen.org/feature/screen.width", null });\r
             }
             catch (Exception e)
             {
                 Console.WriteLine(e.ToString());
-                Console.WriteLine("Fail to preload ElmSharp");
-            }
-        }
-
-        static void PreloadSystemInfo()\r
-        {\r
-            try
-            {
-                Assembly assem = LoadAssembly("Tizen.System.Information");
-                var type = assem.GetType("Tizen.System.Information");
-                type.GetMethod("TryGetValue", BindingFlags.Static | BindingFlags.Public).MakeGenericMethod(typeof(int)).Invoke(null, new object[]{ "http://tizen.org/feature/screen.width", null});
+                Console.WriteLine("Fail to preload TizenFX");
             }
-            catch (Exception e)
-            {
-                Console.WriteLine(e.ToString());
-                Console.WriteLine("Fail to preload system information");
-            }\r
-        }
-
-        static void PreloadTizenSynchronizationContext()\r
-        {\r
-            try
-            {\r
-                Assembly assem = LoadAssembly("Tizen.Applications.Common");\r
-                var type = assem.GetType("Tizen.Applications.TizenSynchronizationContext");\r
-                type = type.GetNestedType("GSourceManager", BindingFlags.Static | BindingFlags.NonPublic);\r
-                type.GetMethod("Post", BindingFlags.Static | BindingFlags.Public).Invoke(null, new object[] { null });
-            }\r
-            catch (Exception e)\r
-            {
-                Console.WriteLine(e.ToString());
-                Console.WriteLine("Fail to preload TizenSynchronizationContext");\r
-            }\r
         }
     }
 }