From: JoonghyunCho Date: Tue, 21 Jan 2020 06:51:44 +0000 (+0900) Subject: Add preloading features X-Git-Tag: submit/tizen/20200207.000547~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=61a3e14f356268e959f2c3f53ca2e17d9229177c;p=platform%2Fcore%2Fdotnet%2Flauncher.git Add preloading features --- diff --git a/Managed/Tizen.Init/Tizen.Init.cs b/Managed/Tizen.Init/Tizen.Init.cs index eb6c817..b523677 100644 --- a/Managed/Tizen.Init/Tizen.Init.cs +++ b/Managed/Tizen.Init/Tizen.Init.cs @@ -155,7 +155,7 @@ namespace Tizen.Init { } PreloadLibICU(); - PreloadElmSharp(); + PreloadTizenFX(); PreloadEnd(); } @@ -199,6 +199,13 @@ namespace Tizen.Init { } } + static void PreloadTizenFX() + { + PreloadElmSharp(); + PreloadSystemInfo(); + PreloadTizenSynchronizationContext(); + } + static void PreloadElmSharp() { try @@ -213,5 +220,36 @@ namespace Tizen.Init { Console.WriteLine("Fail to preload ElmSharp"); } } + + static void PreloadSystemInfo() + { + 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}); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + Console.WriteLine("Fail to preload system information"); + } + } + + static void PreloadTizenSynchronizationContext() + { + try + { + Assembly assem = LoadAssembly("Tizen.Applications.Common"); + var type = assem.GetType("Tizen.Applications.TizenSynchronizationContext"); + type = type.GetNestedType("GSourceManager", BindingFlags.Static | BindingFlags.NonPublic); + type.GetMethod("Post", BindingFlags.Static | BindingFlags.Public).Invoke(null, new object[] { null }); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + Console.WriteLine("Fail to preload TizenSynchronizationContext"); + } + } } }