[NUI] Fix comments according to document review
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Common / Size2D.cs
index 8e00d5b..ae13443 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -72,23 +72,22 @@ namespace Tizen.NUI
         /// The property for the width component of a size.
         /// </summary>
         /// <remarks>
-        /// The setter is deprecated in API8 and will be removed in API10. Please use new Size2D(...) constructor.
+        /// The setter is deprecated in API8 and will be removed in API10. Use new Size2D(...) constructor.
         /// </remarks>
         /// <code>
         /// // DO NOT use like the followings!
         /// Size2D size2d = new Size2D();
         /// size2d.Width = 1; 
-        /// // Please USE like this
+        /// // USE like this
         /// int width = 1, height = 2;
         /// Size2D size2d = new Size2D(width, height);
         /// </code>
         /// <since_tizen> 3 </since_tizen>
         public int Width
         {
+            [Obsolete("Do not use this setter, that is deprecated in API8 and will be removed in API10. Use new Size2D(...) constructor")]
             set
             {
-                Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Size2D(...) constructor");
-
                 Interop.Vector2.WidthSet(SwigCPtr, (float)value);
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
 
@@ -106,23 +105,22 @@ namespace Tizen.NUI
         /// The property for the height component of a size.
         /// </summary>
         /// <remarks>
-        /// The setter is deprecated in API8 and will be removed in API10. Please use new Size2D(...) constructor.
+        /// The setter is deprecated in API8 and will be removed in API10. Use new Size2D(...) constructor.
         /// </remarks>
         /// <code>
         /// // DO NOT use like the followings!
         /// Size2D size2d = new Size2D();
         /// size2d.Height = 2; 
-        /// // Please USE like this
+        /// // USE like this
         /// int width = 1, height = 2;
         /// Size2D size2d = new Size2D(width, height);
         /// </code>
         /// <since_tizen> 3 </since_tizen>
         public int Height
         {
+            [Obsolete("Do not use this setter, that is deprecated in API8 and will be removed in API10. Use new Size2D(...) constructor")]
             set
             {
-                Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Size2D(...) constructor");
-
                 Interop.Vector2.HeightSet(SwigCPtr, (float)value);
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
 
@@ -228,7 +226,11 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public static implicit operator Vector2(Size2D size)
         {
-            return new Vector2((float)size?.Width, (float)size.Height);
+            if (size == null)
+            {
+                return null;
+            }
+            return new Vector2(size.Width, size.Height);
         }
 
         /// <summary>
@@ -239,7 +241,11 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public static implicit operator Size2D(Vector2 vector2)
         {
-            return new Size2D((int)vector2?.X, (int)vector2.Y);
+            if (vector2 == null)
+            {
+                return null;
+            }
+            return new Size2D((int)vector2.X, (int)vector2.Y);
         }
 
         /// <summary>
@@ -251,7 +257,11 @@ namespace Tizen.NUI
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static implicit operator Size2D(Size size)
         {
-            return new Size2D((int)size?.Width, (int)size.Height);
+            if (size == null)
+            {
+                return null;
+            }
+            return new Size2D((int)size.Width, (int)size.Height);
         }
 
 
@@ -327,11 +337,6 @@ namespace Tizen.NUI
         [EditorBrowsable(EditorBrowsableState.Never)]
         public object Clone() => new Size2D(Width, Height);
 
-        internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Size2D obj)
-        {
-            return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
-        }
-
         /// <summary>
         /// Gets the size from the pointer.
         /// </summary>