[NUI] Remove since_tizen tag for internal APIs
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / NUIWindowInfo.cs
1 using System;
2 using Tizen.NUI;
3 using Tizen.Applications.ComponentBased.Common;
4
5 namespace Tizen.NUI
6 {
7     /// <summary>
8     /// Window information class for ComponentApplication
9     /// </summary>
10     internal class NUIWindowInfo : IWindowInfo
11     {
12         private const string LogTag = "Tizen.NUI";
13         private Window _win;
14         private int _resId;
15         private bool _disposed = false;
16
17         /// <summary>
18         /// Initializes the NUI Window class.
19         /// </summary>
20         /// <param name="win">The window object of component.</param>
21         internal NUIWindowInfo(Window win)
22         {
23             _win = win;
24         }
25
26         /// <summary>
27         /// Gets the resource ID of window
28         /// </summary>
29         /// <returns>The native handle of window</returns>
30         public int ResourceId
31         {
32             get
33             {
34                 if (_resId == 0)
35                 {
36                     _resId = _win.GetNativeId();
37                     if (_resId != 0)
38                         Log.Info(LogTag, "Fail to get resource ID");
39                 }
40
41                 return _resId;
42             }
43         }
44
45         /// <summary>
46         /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
47         /// </summary>
48         /// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param>
49         protected virtual void Dispose(bool disposing)
50         {
51             if (_disposed)
52                 return;
53
54             if (disposing)
55             {
56                 _win.Dispose();
57                 _win = null;
58             }
59             _disposed = true;
60         }
61
62         /// <summary>
63         /// Dispose the window resources
64         /// </summary>
65         /// <returns></returns>
66         public void Dispose()
67         {
68             Dispose(true);
69             GC.SuppressFinalize(this);
70         }
71     }
72
73 }
74