From: huiyueun <35286162+huiyueun@users.noreply.github.com> Date: Thu, 6 Feb 2020 07:14:24 +0000 (+0900) Subject: [NUI] Modify Instance bug of Application (#1369) X-Git-Tag: submit/tizen_5.5_tv/20200207.005152~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d38896612d3b8df5986dac4f7e83ad946fbcba0b;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Modify Instance bug of Application (#1369) Signed-off-by: huiyu.eun --- diff --git a/src/Tizen.NUI/src/internal/Application.cs b/src/Tizen.NUI/src/internal/Application.cs index 215171f..f1ec214 100755 --- a/src/Tizen.NUI/src/internal/Application.cs +++ b/src/Tizen.NUI/src/internal/Application.cs @@ -1139,7 +1139,7 @@ namespace Tizen.NUI } } - private static Application _instance; // singleton + protected static Application _instance; // singleton public static Application Instance { diff --git a/src/Tizen.NUI/src/internal/ComponentApplication.cs b/src/Tizen.NUI/src/internal/ComponentApplication.cs index ed07bcb..6c186ab 100755 --- a/src/Tizen.NUI/src/internal/ComponentApplication.cs +++ b/src/Tizen.NUI/src/internal/ComponentApplication.cs @@ -9,7 +9,6 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; private List _frameComponentList; - private static ComponentApplication _instance; //singleton internal ComponentApplication(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) { @@ -44,14 +43,6 @@ namespace Tizen.NUI base.Dispose(type); } - public new static ComponentApplication Instance - { - get - { - return _instance; - } - } - public static ComponentApplication NewComponentApplication(string[] args, string stylesheet) { ComponentApplication ret = New(args, stylesheet); diff --git a/src/Tizen.NUI/src/internal/WatchApplication.cs b/src/Tizen.NUI/src/internal/WatchApplication.cs index 6019117..6d88ce5 100755 --- a/src/Tizen.NUI/src/internal/WatchApplication.cs +++ b/src/Tizen.NUI/src/internal/WatchApplication.cs @@ -75,14 +75,6 @@ namespace Tizen.NUI } } - public new static WatchApplication Instance - { - get - { - return _instance; - } - } - public static WatchApplication NewWatchApplication() { WatchApplication ret = New(); @@ -364,7 +356,5 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - - private static WatchApplication _instance; //singleton } } diff --git a/src/Tizen.NUI/src/internal/WidgetApplication.cs b/src/Tizen.NUI/src/internal/WidgetApplication.cs index 3cc69b1..7226695 100755 --- a/src/Tizen.NUI/src/internal/WidgetApplication.cs +++ b/src/Tizen.NUI/src/internal/WidgetApplication.cs @@ -22,7 +22,6 @@ namespace Tizen.NUI internal class WidgetApplication : Application { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private static WidgetApplication _instance; //singleton private Dictionary _widgetInfo; private List _widgetList = new List(); private delegate System.IntPtr CreateWidgetFunctionDelegate(ref string widgetName); @@ -60,14 +59,6 @@ namespace Tizen.NUI base.Dispose(type); } - public new static WidgetApplication Instance - { - get - { - return _instance; - } - } - public static WidgetApplication NewWidgetApplication(string[] args, string stylesheet) { WidgetApplication ret = New(args, stylesheet); @@ -137,7 +128,7 @@ namespace Tizen.NUI public static System.IntPtr WidgetCreateFunction(ref string widgetName) { - Dictionary widgetInfo = Instance.WidgetInfo; + Dictionary widgetInfo = (Instance as WidgetApplication).WidgetInfo; foreach (System.Type widgetType in widgetInfo.Keys) { diff --git a/src/Tizen.NUI/src/public/NUIFrameComponent.cs b/src/Tizen.NUI/src/public/NUIFrameComponent.cs index 2be71ae..c6746bf 100755 --- a/src/Tizen.NUI/src/public/NUIFrameComponent.cs +++ b/src/Tizen.NUI/src/public/NUIFrameComponent.cs @@ -35,16 +35,19 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public override IWindowInfo CreateWindowInfo() { - ComponentApplication.Instance.RegisterFrameComponent(this); - if(ComponentApplication.Instance.GetFrameComponentCount() == 1) + ComponentApplication instance = ComponentApplication.Instance as ComponentApplication; + if(instance) { - Window = ComponentApplication.Instance.GetWindow(); + instance.RegisterFrameComponent(this); + if(instance.GetFrameComponentCount() == 1) + { + Window = instance.GetWindow(); + } + else + { + Window = new Window(); + } } - else - { - Window = new Window(); - } - NUIWindowInfo = new NUIWindowInfo(Window); return NUIWindowInfo; } diff --git a/src/Tizen.NUI/src/public/Widget.cs b/src/Tizen.NUI/src/public/Widget.cs index 2043943..9a040c7 100755 --- a/src/Tizen.NUI/src/public/Widget.cs +++ b/src/Tizen.NUI/src/public/Widget.cs @@ -47,7 +47,7 @@ namespace Tizen.NUI widgetImpl.WidgetInstanceResized += OnWidgetInstanceResized; widgetImpl.WidgetInstanceUpdated += OnWidgetInstanceUpdated; - WidgetApplication.Instance?.AddWidgetInstance(this); + (WidgetApplication.Instance as WidgetApplication)?.AddWidgetInstance(this); } internal Widget(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Widget.Widget_SWIGUpcast(cPtr), cMemoryOwn) diff --git a/src/Tizen.NUI/src/public/Window.cs b/src/Tizen.NUI/src/public/Window.cs index 37794f4..98865e8 100755 --- a/src/Tizen.NUI/src/public/Window.cs +++ b/src/Tizen.NUI/src/public/Window.cs @@ -1014,13 +1014,6 @@ namespace Tizen.NUI return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - internal static Window GetCurrent() - { - Window ret = new Window(Interop.Stage.Stage_GetCurrent(), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - internal static bool IsInstalled() { bool ret = Interop.Stage.Stage_IsInstalled();