diff --git a/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetAssembly.cs b/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetAssembly.cs index 9946fe8caad..206bf788be7 100644 --- a/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetAssembly.cs +++ b/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetAssembly.cs @@ -15,6 +15,7 @@ */ using System; +using System.ComponentModel; using System.IO; using System.Reflection; using System.Runtime.Loader; @@ -35,16 +36,21 @@ protected override Assembly Load(AssemblyName name) } } - internal class NUIGadgetAssembly + /// + /// Represents a class that provides access to the methods and properties of the NUIGadgetAssembly. + /// + /// 10 + [EditorBrowsable(EditorBrowsableState.Never)] + public class NUIGadgetAssembly { private static readonly object _assemblyLock = new object(); private readonly string _assemblyPath; private WeakReference _assemblyRef; private Assembly _assembly = null; - public NUIGadgetAssembly(string assemblyPath) { _assemblyPath = assemblyPath; } + internal NUIGadgetAssembly(string assemblyPath) { _assemblyPath = assemblyPath; } - public void Load() + internal void Load() { lock (_assemblyLock) { @@ -65,9 +71,9 @@ public void Load() } } - public bool IsLoaded { get { return _assembly != null; } } + internal bool IsLoaded { get { return _assembly != null; } } - public NUIGadget CreateInstance(string className) + internal NUIGadget CreateInstance(string className) { lock (_assemblyLock) { @@ -75,7 +81,13 @@ public NUIGadget CreateInstance(string className) } } - public void Unload() + /// + /// Property indicating whether the weak reference to the gadget assembly is still alive. + /// + /// 12 + public bool IsAlive { get { return _assemblyRef.IsAlive; } } + + internal void Unload() { lock (_assemblyLock) { diff --git a/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetInfo.cs b/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetInfo.cs index d25f5200717..dcd551f43d3 100755 --- a/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetInfo.cs +++ b/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetInfo.cs @@ -87,7 +87,11 @@ public string ResourcePath internal Assembly Assembly { get; set; } - internal NUIGadgetAssembly NUIGadgetAssembly { get; set; } + /// + /// Gets the assembly of the gadget. + /// + /// 12 + public NUIGadgetAssembly NUIGadgetAssembly { get; set; } internal static NUIGadgetInfo CreateNUIGadgetInfo(string packageId) { diff --git a/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetManager.cs b/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetManager.cs index 05aa1746632..c0289ea0bb4 100755 --- a/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetManager.cs +++ b/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetManager.cs @@ -193,7 +193,6 @@ private static void Unload(NUIGadgetInfo info) if (info.NUIGadgetAssembly != null && info.NUIGadgetAssembly.IsLoaded) { info.NUIGadgetAssembly.Unload(); - info.NUIGadgetAssembly = null; } } } @@ -221,7 +220,7 @@ private static void Load(NUIGadgetInfo info, bool useDefaultContext) } else { - if (info.NUIGadgetAssembly == null) + if (info.NUIGadgetAssembly == null || !info.NUIGadgetAssembly.IsLoaded) { Log.Warn("NUIGadgetAssembly.Load(): " + info.ResourcePath + info.ExecutableFile + " ++"); info.NUIGadgetAssembly = new NUIGadgetAssembly(info.ResourcePath + info.ExecutableFile);