Modify dispose issue for window
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Window.cs
index 2ae07d3..9bd4af2 100755 (executable)
@@ -159,12 +159,39 @@ namespace Tizen.NUI
         /// <summary>
         /// Enumeration for transition effect's state.
         /// </summary>
+        [Obsolete("Please do not use! This will be removed. Please use Window.EffectState instead!")]
         [EditorBrowsable(EditorBrowsableState.Never)]
         public enum EffectStates
         {
             /// <summary>
             /// None state.
             /// </summary>
+            [Obsolete("Please do not use! This will be removed. Please use Window.EffectState.None instead!")]
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            None = 0,
+            /// <summary>
+            /// Transition effect is started.
+            /// </summary>
+            [Obsolete("Please do not use! This will be removed. Please use Window.EffectState.Start instead!")]
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Start,
+            /// <summary>
+            /// Transition effect is ended.
+            /// </summary>
+            [Obsolete("Please do not use! This will be removed. Please use Window.EffectState.End instead!")]
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            End,
+        }
+
+        /// <summary>
+        /// Enumeration for transition effect's state.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public enum EffectState
+        {
+            /// <summary>
+            /// None state.
+            /// </summary>
             [EditorBrowsable(EditorBrowsableState.Never)]
             None = 0,
             /// <summary>
@@ -182,12 +209,39 @@ namespace Tizen.NUI
         /// <summary>
         /// Enumeration for transition effect's type.
         /// </summary>
+        [Obsolete("Please do not use! This will be removed. Please use Window.EffectType instead!")]
         [EditorBrowsable(EditorBrowsableState.Never)]
         public enum EffectTypes
         {
             /// <summary>
             /// None type.
             /// </summary>
+            [Obsolete("Please do not use! This will be removed. Please use Window.EffectType.None instead!")]
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            None = 0,
+            /// <summary>
+            /// Window show effect.
+            /// </summary>
+            [Obsolete("Please do not use! This will be removed. Please use Window.EffectType.Show instead!")]
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Show,
+            /// <summary>
+            /// Window hide effect.
+            /// </summary>
+            [Obsolete("Please do not use! This will be removed. Please use Window.EffectType.Hide instead!")]
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Hide,
+        }
+
+        /// <summary>
+        /// Enumeration for transition effect's type.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public enum EffectType
+        {
+            /// <summary>
+            /// None type.
+            /// </summary>
             [EditorBrowsable(EditorBrowsableState.Never)]
             None = 0,
             /// <summary>
@@ -369,6 +423,7 @@ namespace Tizen.NUI
                 Position2D position = GetPosition();
                 Size2D size = GetSize();
                 Rectangle ret = new Rectangle(position.X, position.Y, size.Width, size.Height);
+                position.Dispose();
                 return ret;
             }
             set
@@ -1111,11 +1166,17 @@ namespace Tizen.NUI
             {
                 for (int i = 0; i < orientations.Count; i++)
                 {
-                    orientationArray.PushBack(new PropertyValue((int)orientations[i]));
+                    PropertyValue value = new PropertyValue((int)orientations[i]);
+                    orientationArray.PushBack(value);
                 }
             }
 
             Interop.Window.SetAvailableOrientations(SwigCPtr, PropertyArray.getCPtr(orientationArray));
+            for (uint i = 0; i < orientationArray.Count(); i++)
+            {
+                orientationArray[i].Dispose();
+            }
+            orientationArray.Dispose();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
@@ -1168,6 +1229,7 @@ namespace Tizen.NUI
         {
             var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), false);
             Vector2 ret = new Vector2(val.GetWidth(), val.GetHeight());
+            val.Dispose();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -1255,9 +1317,8 @@ namespace Tizen.NUI
             }
             var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
             Interop.Window.SetSize(SwigCPtr, Uint16Pair.getCPtr(val));
-
+            val.Dispose();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
             // Resetting Window size should request a relayout of the tree.
         }
 
@@ -1265,7 +1326,7 @@ namespace Tizen.NUI
         {
             var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), false);
             Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
-
+            val.Dispose();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -1278,7 +1339,7 @@ namespace Tizen.NUI
             }
             var val = new Uint16Pair((uint)position.X, (uint)position.Y);
             Interop.Window.SetPosition(SwigCPtr, Uint16Pair.getCPtr(val));
-
+            val.Dispose();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             // Setting Position of the window should request a relayout of the tree.
         }
@@ -1287,7 +1348,7 @@ namespace Tizen.NUI
         {
             var val = new Uint16Pair(Interop.Window.GetPosition(SwigCPtr), true);
             Position2D ret = new Position2D(val.GetX(), val.GetY());
-
+            val.Dispose();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -1433,7 +1494,7 @@ namespace Tizen.NUI
         /// <code>
         /// void MyFunction( int frameId )
         /// </code>
-        /// This callback will be deleted once it is called. 
+        /// This callback will be deleted once it is called.
         /// <remarks>
         /// Ownership of the callback is passed onto this class
         /// </remarks>
@@ -1456,7 +1517,7 @@ namespace Tizen.NUI
         /// <code>
         /// void MyFunction( int frameId )
         /// </code>
-        /// This callback will be deleted once it is called. 
+        /// This callback will be deleted once it is called.
         /// <remarks>
         /// Ownership of the callback is passed onto this class
         /// </remarks>