*/
using System;
+using System.ComponentModel;
using System.IO;
using System.Reflection;
using System.Runtime.Loader;
}
}
- internal class NUIGadgetAssembly
+ /// <summary>
+ /// Represents a class that provides access to the methods and properties of the NUIGadgetAssembly.
+ /// </summary>
+ /// <since_tizen> 10 </since_tizen>
+ [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)
{
}
}
- 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)
{
}
}
- public void Unload()
+ /// <summary>
+ /// Property indicating whether the weak reference to the gadget assembly is still alive.
+ /// </summary>
+ /// <since_tizen> 12 </since_tizen>
+ public bool IsAlive { get { return _assemblyRef.IsAlive; } }
+
+ internal void Unload()
{
lock (_assemblyLock)
{
internal Assembly Assembly { get; set; }
- internal NUIGadgetAssembly NUIGadgetAssembly { get; set; }
+ /// <summary>
+ /// Gets the assembly of the gadget.
+ /// </summary>
+ /// <since_tizen> 12 </since_tizen>
+ public NUIGadgetAssembly NUIGadgetAssembly { get; set; }
internal static NUIGadgetInfo CreateNUIGadgetInfo(string packageId)
{
if (info.NUIGadgetAssembly != null && info.NUIGadgetAssembly.IsLoaded)
{
info.NUIGadgetAssembly.Unload();
- info.NUIGadgetAssembly = null;
}
}
}
}
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);