Sync upstream
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / PropertyValue.cs
index dad4f99..b0ea75d 100755 (executable)
@@ -25,12 +25,6 @@ namespace Tizen.NUI
     /// <since_tizen> 3 </since_tizen>
     public class PropertyValue : Disposable
     {
-        /// <summary>
-        /// swigCMemOwn
-        /// </summary>
-        /// <since_tizen> 3 </since_tizen>
-        protected bool swigCMemOwn;
-        private global::System.Runtime.InteropServices.HandleRef swigCPtr;
 
         /// <summary>
         /// Creates a Size2D property value.
@@ -230,10 +224,8 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        internal PropertyValue(global::System.IntPtr cPtr, bool cMemoryOwn)
+        internal PropertyValue(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
         {
-            swigCMemOwn = cMemoryOwn;
-            swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
         }
 
         internal PropertyValue(Matrix3 matrixValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_7(Matrix3.getCPtr(matrixValue)), true)
@@ -339,6 +331,10 @@ namespace Tizen.NUI
             {
                 value = new PropertyValue((Extents)obj);
             }
+            else if (type.Equals(typeof(Rectangle)))
+            {
+                value = new PropertyValue((Rectangle)obj);
+            }
             else
             {
                 throw new global::System.InvalidOperationException("Unimplemented type for Property Value :" + type.Name);
@@ -647,31 +643,31 @@ namespace Tizen.NUI
             return ret;
         }
 
-        /// <summary>
-        /// Dispose.
-        /// </summary>
-        /// <since_tizen> 3 </since_tizen>
-        protected override void Dispose(DisposeTypes type)
+        /// This will not be public opened.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
         {
-            if (disposed)
-            {
-                return;
-            }
+            Interop.PropertyValue.delete_Property_Value(swigCPtr);
+        }
 
-            //Release your own unmanaged resources here.
-            //You should not access any managed member here except static instance.
-            //because the execution order of Finalizes is non-deterministic.
+        internal static PropertyValue CreateWithGuard(string value)
+        {
+            return value == null ? new PropertyValue() : new PropertyValue(value);
+        }
 
-            if (swigCPtr.Handle != global::System.IntPtr.Zero)
-            {
-                if (swigCMemOwn)
-                {
-                    swigCMemOwn = false;
-                    Interop.PropertyValue.delete_Property_Value(swigCPtr);
-                }
-                swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-            }
-            base.Dispose(type);
+        internal static PropertyValue CreateWithGuard(Vector2 value)
+        {
+            return value == null ? new PropertyValue() : new PropertyValue(value);
+        }
+
+        internal static PropertyValue CreateWithGuard(Rectangle value)
+        {
+            return value == null ? new PropertyValue() : new PropertyValue(value);
+        }
+
+        internal static PropertyValue CreateWithGuard(Color value)
+        {
+            return value == null ? new PropertyValue() : new PropertyValue(value);
         }
     }
 }