public static Application NewApplication()
{
- return NewApplication("", Application.WindowMode.Opaque);
+ return NewApplication("", NUIApplication.WindowMode.Opaque);
}
public static Application NewApplication(string stylesheet)
{
- return NewApplication(stylesheet, Application.WindowMode.Opaque);
+ return NewApplication(stylesheet, NUIApplication.WindowMode.Opaque);
}
- public static Application NewApplication(string stylesheet, Application.WindowMode windowMode)
+ public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode)
{
// register all Views with the type registry, so that can be created / styled via JSON
//ViewRegistryHelper.Initialize(); //moved to Application side.
return ret;
}
- public static Application NewApplication(string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
+ public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
{
if (_instance)
{
return ret;
}
- public static Application NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode)
+ public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode)
{
if (_instance)
{
return _instance;
}
- Application ret = New(args, stylesheet, (Application.WindowMode)windowMode);
+ Application ret = New(args, stylesheet, windowMode);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
// set the singleton
return _instance;
}
- public static Application NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
+ public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
{
if (_instance)
{
return _instance;
}
- Application ret = New(args, stylesheet, (Application.WindowMode)windowMode, positionSize);
+ Application ret = New(args, stylesheet, windowMode, positionSize);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
// set the singleton
return ret;
}
- public static Application New(int argc, string stylesheet, Application.WindowMode windowMode)
+ public static Application New(int argc, string stylesheet, NUIApplication.WindowMode windowMode)
{
Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- public static Application New(string[] args, string stylesheet, Application.WindowMode windowMode)
+ public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode)
{
Application ret = null;
int argc = 0;
return ret;
}
- public static Application New(int argc, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
+ public static Application New(int argc, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
{
Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- public static Application New(string[] args, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
+ public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
{
Application ret = null;
int argc = 0;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
-
- public enum WindowMode
- {
- Opaque = 0,
- Transparent = 1
- }
}
}
/// <summary>
/// The Application instance to connect event.
/// </summary>
- protected Application _application;
- private string _stylesheet = "";
- private NUIApplication.WindowMode _windowMode = NUIApplication.WindowMode.Opaque;
- private Size2D _windowSize = null;
- private Position2D _windowPosition = null;
+ protected Application application;
+ private string stylesheet = "";
+ private NUIApplication.WindowMode windowMode = NUIApplication.WindowMode.Opaque;
+ private Rectangle windowRectangle = null;
/// <summary>
/// The Dictionary to contain each type of event callback.
/// </summary>
public NUICoreBackend(string stylesheet)
{
- _stylesheet = stylesheet;
+ this.stylesheet = stylesheet;
}
/// <summary>
/// </summary>
public NUICoreBackend(string stylesheet, NUIApplication.WindowMode windowMode)
{
- _stylesheet = stylesheet;
- _windowMode = windowMode;
+ this.stylesheet = stylesheet;
+ this.windowMode = windowMode;
}
/// <summary>
/// </summary>
public NUICoreBackend(string stylesheet, NUIApplication.WindowMode windowMode, Size2D windowSize, Position2D windowPosition)
{
- _stylesheet = stylesheet;
- _windowMode = windowMode;
- _windowSize = windowSize;
- _windowPosition = windowPosition;
+ this.stylesheet = stylesheet;
+ this.windowMode = windowMode;
+ if (windowSize != null && windowPosition != null)
+ {
+ this.windowRectangle = new Rectangle(windowPosition.X, windowPosition.Y, windowSize.Width, windowSize.Height);
+ }
}
/// <summary>
/// </summary>
public void Dispose()
{
- if (_application != null)
- {
- _application.Dispose();
- }
- if (_windowSize != null)
+ if (application != null)
{
- _windowSize.Dispose();
+ application.Dispose();
}
- if (_windowPosition != null)
+ if (windowRectangle != null)
{
- _windowPosition.Dispose();
+ windowRectangle.Dispose();
}
}
/// </summary>
public void Exit()
{
- if (_application != null)
+ if (application != null)
{
- _application.Quit();
+ application.Quit();
}
}
/// <returns>true if added successfully, false otherwise</returns>
public bool AddIdle(System.Delegate func)
{
- return _application.AddIdle(func);
+ return application.AddIdle(func);
}
/// <summary>
args[0] = this.GetType().Assembly.FullName;
}
- if (args.Length == 1)
+ if (windowRectangle != null)
{
- if (_windowSize != null)
- {
- _application = Application.NewApplication(_stylesheet, (Application.WindowMode)_windowMode, new Rectangle(_windowPosition.X, _windowPosition.Y, _windowSize.Width, _windowSize.Height));
- }
- else
- {
- _application = Application.NewApplication(_stylesheet, (Application.WindowMode)_windowMode);
- }
+ application = Application.NewApplication(args, stylesheet, windowMode, windowRectangle);
}
- else if (args.Length > 1)
+ else
{
- if (_windowSize != null)
- {
- _application = Application.NewApplication(args, _stylesheet, (Application.WindowMode)_windowMode, new Rectangle(_windowPosition.X, _windowPosition.Y, _windowSize.Width, _windowSize.Height));
- }
- else
- {
- _application = Application.NewApplication(args, _stylesheet, (Application.WindowMode)_windowMode);
- }
+ application = Application.NewApplication(args, stylesheet, windowMode);
}
- _application.BatteryLow += OnBatteryLow;
- _application.LanguageChanged += OnLanguageChanged;
- _application.MemoryLow += OnMemoryLow;
- _application.RegionChanged += OnRegionChanged;
+ application.BatteryLow += OnBatteryLow;
+ application.LanguageChanged += OnLanguageChanged;
+ application.MemoryLow += OnMemoryLow;
+ application.RegionChanged += OnRegionChanged;
- _application.Initialized += OnInitialized;
- _application.Resumed += OnResumed;
- _application.Terminating += OnTerminated;
- _application.Paused += OnPaused;
- _application.AppControl += OnAppControl;
+ application.Initialized += OnInitialized;
+ application.Resumed += OnResumed;
+ application.Terminating += OnTerminated;
+ application.Paused += OnPaused;
+ application.AppControl += OnAppControl;
- _application.MainLoop();
- _application.Dispose();
+ application.MainLoop();
+ application.Dispose();
}
/// <summary>
{
get
{
- return _application;
+ return application;
}
}
}
/// The instance of ResourceManager.
/// </summary>
private static System.Resources.ResourceManager resourceManager = null;
- private Size2D _windowSize2D = null;
- private Position2D _windowPosition2D = null;
- private TransitionOptions transitionOptions;
- private string appId = null;
- internal static NUIApplication me;
-
- private static bool isPreload = false;
// TODO Enable this after tizen-theme-manager is released.
// private readonly ThemeLoader themeLoader = new ThemeLoader();
+ static NUIApplication()
+ {
+ Registry.Instance.SavedApplicationThread = Thread.CurrentThread;
+ // TODO Enable this after tizen-theme-manager is released.
+ // themeLoader.ThemeChanged += TizenThemeChanged;
+ }
+
/// <summary>
/// The default constructor.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")]
public NUIApplication() : base(new NUICoreBackend())
{
- Registry.Instance.SavedApplicationThread = Thread.CurrentThread;
- me = this;
-
- // TODO Enable this after tizen-theme-manager is released.
- // themeLoader.ThemeChanged += TizenThemeChanged;
}
/// <summary>
/// <param name="windowPosition">The window position.</param>
/// <since_tizen> 5 </since_tizen>
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")]
[EditorBrowsable(EditorBrowsableState.Never)]
- public NUIApplication(Size2D windowSize, Position2D windowPosition) : base(new NUICoreBackend("", WindowMode.Opaque, windowSize, windowPosition))
+ public NUIApplication(Size2D windowSize, Position2D windowPosition) : base(new NUICoreBackend("", NUIApplication.WindowMode.Opaque, windowSize, windowPosition))
{
- Registry.Instance.SavedApplicationThread = Thread.CurrentThread;
- // TODO Enable this after tizen-theme-manager is released.
- // themeLoader.ThemeChanged += TizenThemeChanged;
- _windowSize2D = windowSize;
- _windowPosition2D = windowPosition;
- me = this;
}
/// <summary>
/// </summary>
/// <param name="styleSheet">The styleSheet url.</param>
/// <since_tizen> 3 </since_tizen>
+ [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")]
public NUIApplication(string styleSheet) : base(new NUICoreBackend(styleSheet))
{
- Registry.Instance.SavedApplicationThread = Thread.CurrentThread;
- me = this;
- // TODO Enable this after tizen-theme-manager is released.
- // themeLoader.ThemeChanged += TizenThemeChanged;
}
/// <summary>
/// <param name="windowPosition">The window position.</param>
/// <since_tizen> 5 </since_tizen>
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")]
[EditorBrowsable(EditorBrowsableState.Never)]
public NUIApplication(string styleSheet, Size2D windowSize, Position2D windowPosition) : base(new NUICoreBackend(styleSheet, WindowMode.Opaque, windowSize, windowPosition))
{
- Registry.Instance.SavedApplicationThread = Thread.CurrentThread;
- // TODO Enable this after tizen-theme-manager is released.
- // themeLoader.ThemeChanged += TizenThemeChanged;
- _windowSize2D = windowSize;
- _windowPosition2D = windowPosition;
- me = this;
}
/// <summary>
/// <param name="styleSheet">The styleSheet url.</param>
/// <param name="windowMode">The windowMode.</param>
/// <since_tizen> 3 </since_tizen>
+ [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")]
public NUIApplication(string styleSheet, WindowMode windowMode) : base(new NUICoreBackend(styleSheet, windowMode))
{
- Registry.Instance.SavedApplicationThread = Thread.CurrentThread;
- me = this;
- // TODO Enable this after tizen-theme-manager is released.
- // themeLoader.ThemeChanged += TizenThemeChanged;
}
/// <summary>
/// <param name="windowPosition">The window position.</param>
/// <since_tizen> 5 </since_tizen>
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")]
[EditorBrowsable(EditorBrowsableState.Never)]
public NUIApplication(string styleSheet, WindowMode windowMode, Size2D windowSize, Position2D windowPosition) : base(new NUICoreBackend(styleSheet, windowMode, windowSize, windowPosition))
{
- Registry.Instance.SavedApplicationThread = Thread.CurrentThread;
- // TODO Enable this after tizen-theme-manager is released.
- // themeLoader.ThemeChanged += TizenThemeChanged;
- _windowSize2D = windowSize;
- _windowPosition2D = windowPosition;
- me = this;
}
/// <summary>
//windowMode and styleSheet will be added later. currenlty it's not working as expected.
Graphics.Backend = backend;
Tizen.Log.Error("NUI", "Plaese DO NOT set graphical backend type with this constructor! This will give no effect!");
-
- if (windowSize != null) { _windowSize2D = windowSize; }
- if (windowPosition != null) { _windowPosition2D = windowPosition; }
- Registry.Instance.SavedApplicationThread = Thread.CurrentThread;
- me = this;
- // TODO Enable this after tizen-theme-manager is released.
- // themeLoader.ThemeChanged += TizenThemeChanged;
}
/// <summary>
{
get
{
- return appId;
+ return Tizen.Applications.Application.Current.ApplicationInfo.ApplicationId;
}
}
protected override void OnCreate()
{
base.OnCreate();
- appId = Tizen.Applications.Application.Current.ApplicationInfo.ApplicationId;
}
/// <summary>
static public void Preload()
{
Interop.Application.PreInitialize();
- isPreload = true;
+ IsPreload = true;
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public void SendLaunchRequest(AppControl appControl)
{
- transitionOptions.SendLaunchRequest(appControl);
+ TransitionOptions?.SendLaunchRequest(appControl);
}
/// <summary>
/// This is used to improve application launch performance.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public TransitionOptions TransitionOptions
- {
- get
- {
- return transitionOptions;
- }
- set
- {
- transitionOptions = value;
- }
- }
+ public TransitionOptions TransitionOptions { get; set; }
// TODO Enable this after tizen-theme-manager is released.
// private void TizenThemeChanged(object sender, ThemeEventArgs e)
/// <summary>
/// Check if it is loaded as dotnet-loader-nui.
/// </summary>
- static internal bool IsPreload
- {
- get
- {
- return isPreload;
- }
- }
+ static internal bool IsPreload { get; set; }
}
/// <summary>
/// Creates a new widgetView manager object.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- internal WidgetViewManager() : this(Interop.WidgetViewManager.New(Application.getCPtr(NUIApplication.me?.ApplicationHandle), NUIApplication.me?.AppId), true)
+ internal WidgetViewManager() : this(Interop.WidgetViewManager.New(Application.Instance.SwigCPtr, Applications.Application.Current.ApplicationInfo.ApplicationId), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
{
get
{
- if(!instance)
+ if (!instance)
{
- instance = new WidgetViewManager();
+ instance = new WidgetViewManager();
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
return instance;
+++ /dev/null
-using System.ComponentModel;
-
-namespace Tizen.NUI.Binding
-{
- /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public interface IRegisterable
- {
- }
-}
{
static Registrar()
{
- Registered = new Registrar<IRegisterable>();
}
internal static Dictionary<string, Type> Effects { get; } = new Dictionary<string, Type>();
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public static IEnumerable<Assembly> ExtraAssemblies { get; set; }
-
- /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static Registrar<IRegisterable> Registered { get; internal set; }
}
}