using System;
using Tizen.NUI;
using Tizen.Applications.ComponentBased.Common;
namespace Tizen.NUI
{
///
/// Window information class for ComponentApplication
///
internal class NUIWindowInfo : IWindowInfo
{
private const string LogTag = "Tizen.NUI";
private Window _win;
private int _resId;
private bool _disposed = false;
///
/// Initializes the NUI Window class.
///
/// The window object of component.
/// 6
internal NUIWindowInfo(Window win)
{
_win = win;
}
///
/// Gets the resource ID of window
///
/// The native handle of window
public int ResourceId
{
get
{
if (_resId == 0)
{
_resId = _win.GetNativeId();
if (_resId != 0)
Log.Info(LogTag, "Fail to get resource ID");
}
return _resId;
}
}
///
/// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
///
/// If true, disposes any disposable objects. If false, does not dispose disposable objects.
protected virtual void Dispose(bool disposing)
{
if (_disposed)
return;
if (disposing)
{
_win.Dispose();
_win = null;
}
_disposed = true;
}
///
/// Dispose the window resources
///
///
/// 6
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
}
}