[NUI] CanvasView: Change viewBox method to property
authorJunsuChoi <jsuya.choi@samsung.com>
Fri, 13 Aug 2021 02:31:35 +0000 (11:31 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 18 Aug 2021 03:10:44 +0000 (12:10 +0900)
Changes viewbox interface method to property.

src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/CanvasView.cs

index bcaf585..137f0fd 100755 (executable)
@@ -90,36 +90,26 @@ namespace Tizen.NUI.BaseComponents.VectorGraphics
         }
 
         /// <summary>
-        /// Set size of CanvasView's viewbox.
+        /// The viewbox of the CanvasView.
         /// </summary>
-        /// <param name="viewBox">The size of viewBox</param>
-        /// <exception cref="ArgumentNullException"> Thrown when drawable is null. </exception>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public void SetViewBoxSize(Size2D viewBox)
+        public Size2D ViewBox
         {
-            if (viewBox == null)
+            get
             {
-                throw new ArgumentNullException(nameof(viewBox));
+                Size2D retVal = new Size2D(0, 0);
+                PropertyValue viewBoxPropertyValue = GetProperty(Interop.CanvasView.PropertyViewBoxGet());
+                viewBoxPropertyValue?.Get(retVal);
+                viewBoxPropertyValue?.Dispose();
+                return retVal;
+            }
+            set
+            {
+                PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
+                SetProperty(Interop.CanvasView.PropertyViewBoxGet(), setVal);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                setVal?.Dispose();
             }
-            PropertyValue setVal = new Tizen.NUI.PropertyValue(viewBox);
-            SetProperty(Interop.CanvasView.PropertyViewBoxGet(), setVal);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            setVal?.Dispose();
-        }
-
-        /// <summary>
-        /// Get size of CanvasView's viewbox.
-        /// </summary>
-        /// <returns>The size of viewBox</returns>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public Size2D GetViewBoxSize()
-        {
-            Size2D retVal = new Size2D(0, 0);
-            PropertyValue viewBoxPropertyValue = GetProperty(Interop.CanvasView.PropertyViewBoxGet());
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            viewBoxPropertyValue?.Get(retVal);
-            viewBoxPropertyValue?.Dispose();
-            return retVal;
         }
 
         /// <summary>