[NUI] Revert patch about StyleManager (#1970)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Rectangle.cs
index 903990e..372f623 100755 (executable)
@@ -48,6 +48,10 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
+        internal Rectangle(Rectangle other) : this(other.x, other.y, other.width, other.height)
+        {
+        }
+
         internal Rectangle(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
         {
         }
@@ -58,10 +62,25 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
+        internal Rectangle(RectangleChangedCallback cb) : this()
+        {
+        }
+
         internal Rectangle(RectangleChangedCallback cb, Rectangle other) : this(cb, other.x, other.y, other.width, other.height)
         {
         }
 
+        /// <summary>
+        /// The type cast operator, int to Rectangle.
+        /// </summary>
+        /// <param name="value">A value of int type.</param>
+        /// <returns>return a Extents instance</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static implicit operator Rectangle(int value)
+        {
+            return new Rectangle(value, value, value, value);
+        }
+
         internal delegate void RectangleChangedCallback(int x, int y, int width, int height);
         private RectangleChangedCallback callback = null;
 
@@ -449,5 +468,10 @@ namespace Tizen.NUI
         {
             Interop.Rectangle.delete_Rectangle(swigCPtr);
         }
+
+        /// <summary>
+        /// Determines whether the reference is null or the Rectangle has all 0 properties.
+        /// </summary>
+        internal static bool IsNullOrZero(Rectangle rectangle) => (rectangle == null || (rectangle.top == 0 && rectangle.right == 0 && rectangle.bottom == 0 && rectangle.left == 0));
     }
 }
\ No newline at end of file