Revert "[NUI] Fix CA2000 warning issues of View and ViewImpl."
authorJiyun Yang <ji.yang@samsung.com>
Thu, 7 Jan 2021 12:07:13 +0000 (21:07 +0900)
committerhuiyueun <35286162+huiyueun@users.noreply.github.com>
Mon, 11 Jan 2021 05:49:43 +0000 (14:49 +0900)
This reverts commit 424bdae58a6f7d71ad3e531fd157a92d513255c4.

src/Tizen.NUI/src/internal/ViewImpl.cs
src/Tizen.NUI/src/public/BaseComponents/View.cs

index 57dc60e..445f98c 100755 (executable)
@@ -567,48 +567,27 @@ namespace Tizen.NUI
 
         private void SwigDirectorOnPropertySet(int index, global::System.IntPtr propertyValue)
         {
-            using (PropertyValue setValue = new PropertyValue(propertyValue, true))
-            {
-                OnPropertySet(index, setValue);
-            }
+            OnPropertySet(index, new PropertyValue(propertyValue, true));
         }
 
         private void SwigDirectorOnSizeSet(global::System.IntPtr targetSize)
         {
-            using (Vector3 setValue = new Vector3(targetSize, false))
-            {
-                OnSizeSet(setValue);
-            }
+            OnSizeSet(new Vector3(targetSize, false));
         }
 
         private void SwigDirectorOnSizeAnimation(global::System.IntPtr animation, global::System.IntPtr targetSize)
         {
-            using (Animation setAnimation = new Animation(animation, false))
-            {
-                using (Vector3 setTargetSize = new Vector3(targetSize, false))
-                {
-                    OnSizeAnimation(setAnimation, setTargetSize);
-                }
-            }
+            OnSizeAnimation(new Animation(animation, false), new Vector3(targetSize, false));
         }
 
         private bool SwigDirectorOnKeyEvent(global::System.IntPtr arg0)
         {
-            using (Key setKey = new Key(arg0, false))
-            {
-                return OnKeyEvent(setKey);
-            }
+            return OnKeyEvent(new Key(arg0, false));
         }
 
         private void SwigDirectorOnRelayout(global::System.IntPtr size, global::System.IntPtr container)
         {
-            using (Vector2 setSize = new Vector2(size, false))
-            {
-                using (RelayoutContainer setContainer = new RelayoutContainer(container, false))
-                {
-                    OnRelayout(setSize, setContainer);
-                }
-            }
+            OnRelayout(new Vector2(size, false), new RelayoutContainer(container, false));
         }
 
         private void SwigDirectorOnSetResizePolicy(int policy, int dimension)
@@ -682,10 +661,7 @@ namespace Tizen.NUI
 
         private bool SwigDirectorOnAccessibilityPan(global::System.IntPtr gesture)
         {
-            using (PanGesture setPanGesture = new PanGesture(gesture, true)) 
-            {
-                return OnAccessibilityPan(setPanGesture);
-            }
+            return OnAccessibilityPan(new PanGesture(gesture, true));
         }
 
         private bool SwigDirectorOnAccessibilityValueChange(bool isIncrease)
@@ -725,50 +701,32 @@ namespace Tizen.NUI
 
         private void SwigDirectorOnPinch(global::System.IntPtr pinch)
         {
-            using (PinchGesture setPinch = new PinchGesture(pinch, false))
-            {
-                OnPinch(setPinch);
-            }
+            OnPinch(new PinchGesture(pinch, false));
         }
 
         private void SwigDirectorOnPan(global::System.IntPtr pan)
         {
-            using (PanGesture setPan = new PanGesture(pan, false))
-            {
-                OnPan(setPan);
-            }
+            OnPan(new PanGesture(pan, false));
         }
 
         private void SwigDirectorOnTap(global::System.IntPtr tap)
         {
-            using (TapGesture setTapGesture = new TapGesture(tap, false))
-            {
-                OnTap(setTapGesture);
-            }
+            OnTap(new TapGesture(tap, false));
         }
 
         private void SwigDirectorOnLongPress(global::System.IntPtr longPress)
         {
-            using (LongPressGesture setLongPress = new LongPressGesture(longPress, false))
-            {
-                OnLongPress(setLongPress);
-            }
+            OnLongPress(new LongPressGesture(longPress, false));
         }
 
         private void SwigDirectorSignalConnected(global::System.IntPtr slotObserver, global::System.IntPtr callback)
         {
-            using (SlotObserver setSlotObserver = new SlotObserver(slotObserver, false))
-            {
-                SignalConnected((slotObserver == global::System.IntPtr.Zero) ? null : setSlotObserver, (callback == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_Dali__CallbackBase(callback));
-            }
+            SignalConnected((slotObserver == global::System.IntPtr.Zero) ? null : new SlotObserver(slotObserver, false), (callback == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_Dali__CallbackBase(callback));
         }
 
         private void SwigDirectorSignalDisconnected(global::System.IntPtr slotObserver, global::System.IntPtr callback)
         {
-            using (SlotObserver setSlotObserver = new SlotObserver(slotObserver, false))
-            {
-                SignalDisconnected((slotObserver == global::System.IntPtr.Zero) ? null : setSlotObserver, (callback == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_Dali__CallbackBase(callback));
-            }
+            SignalDisconnected((slotObserver == global::System.IntPtr.Zero) ? null : new SlotObserver(slotObserver, false), (callback == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_Dali__CallbackBase(callback));
         }
 
         public delegate void SwigDelegateViewImpl_0(int depth);
index 1570215..ade387f 100755 (executable)
@@ -536,11 +536,8 @@ namespace Tizen.NUI.BaseComponents
             }
             set
             {
-                using (PropertyValue setValue = new Tizen.NUI.PropertyValue(value))
-                {
-                    SetProperty(View.Property.TOOLTIP, setValue);
-                    NotifyPropertyChanged();
-                }
+                SetProperty(View.Property.TOOLTIP, new Tizen.NUI.PropertyValue(value));
+                NotifyPropertyChanged();
             }
         }
 
@@ -911,15 +908,9 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                using (PropertyValue screenPosition = GetProperty(View.Property.ScreenPosition)) 
-                {
-                    using (Vector2 vectorValue = new Vector2(0.0f, 0.0f))
-                    {
-                        Vector2 position = vectorValue;
-                        screenPosition?.Get(position);
-                        return position;
-                    }
-                }
+                Vector2 temp = new Vector2(0.0f, 0.0f);
+                GetProperty(View.Property.ScreenPosition).Get(temp);
+                return temp;
             }
         }
 
@@ -959,20 +950,14 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                using (PropertyValue positionUsesAnchor = GetProperty(View.Property.PositionUsesAnchorPoint))
-                {
-                    bool returnValue = false;
-                    positionUsesAnchor?.Get(out returnValue);
-                    return returnValue;
-                }
+                bool temp = false;
+                GetProperty(View.Property.PositionUsesAnchorPoint).Get(out temp);
+                return temp;
             }
             set
             {
-                using (PropertyValue setValue = new Tizen.NUI.PropertyValue(value))
-                {
-                    SetProperty(View.Property.PositionUsesAnchorPoint, setValue);
-                    NotifyPropertyChanged();
-                }
+                SetProperty(View.Property.PositionUsesAnchorPoint, new Tizen.NUI.PropertyValue(value));
+                NotifyPropertyChanged();
             }
         }
 
@@ -1055,13 +1040,10 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                using (Vector3 vectorValue = new Vector3(Interop.Actor.GetNaturalSize(SwigCPtr), true))
-                {
-                    Vector3 naturalSize = vectorValue;
-                    if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
+                Vector3 temp = new Vector3(Interop.Actor.GetNaturalSize(SwigCPtr), true);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
 
-                    return new Size2D((int)naturalSize?.Width, (int)naturalSize?.Height);
-                }
+                return new Size2D((int)temp.Width, (int)temp.Height);
             }
         }
 
@@ -1257,15 +1239,9 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                using (PropertyValue worldPos = GetProperty(View.Property.WorldPosition))
-                {
-                    using (Vector3 vectorValue = new Vector3(0.0f, 0.0f, 0.0f))
-                    {
-                        Vector3 position = vectorValue;
-                        worldPos?.Get(position);
-                        return position;
-                    }
-                }
+                Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
+                GetProperty(View.Property.WorldPosition).Get(temp);
+                return temp;
             }
         }
 
@@ -1303,14 +1279,9 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                using (PropertyValue worldOri = GetProperty(View.Property.WorldOrientation))
-                {
-                    using (Rotation rotation = new Rotation())
-                    {
-                        worldOri?.Get(rotation);
-                        return rotation;
-                    }
-                }
+                Rotation temp = new Rotation();
+                GetProperty(View.Property.WorldOrientation).Get(temp);
+                return temp;
             }
         }
 
@@ -1412,14 +1383,9 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                using (PropertyValue worldScale = GetProperty(View.Property.WorldScale))
-                {
-                    using (Vector3 vectorValue = new Vector3(0.0f, 0.0f, 0.0f))
-                    {
-                        worldScale?.Get(vectorValue);
-                        return vectorValue;
-                    }
-                }
+                Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
+                GetProperty(View.Property.WorldScale).Get(temp);
+                return temp;
             }
         }
 
@@ -1440,12 +1406,9 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                using (PropertyValue visible = GetProperty(View.Property.VISIBLE))
-                {
-                    bool isVisible = false;
-                    visible?.Get(out isVisible);
-                    return isVisible;
-                }
+                bool temp = false;
+                GetProperty(View.Property.VISIBLE).Get(out temp);
+                return temp;
             }
         }
 
@@ -1457,14 +1420,9 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                using (PropertyValue worldColor = GetProperty(View.Property.WorldColor))
-                {
-                    using (Vector4 vectorValue = new Vector4(0.0f, 0.0f, 0.0f, 0.0f))
-                    {
-                        worldColor?.Get(vectorValue);
-                        return vectorValue;
-                    }
-                }
+                Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
+                GetProperty(View.Property.WorldColor).Get(temp);
+                return temp;
             }
         }
 
@@ -1880,22 +1838,14 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                using (PropertyValue anchorPoint = GetProperty(View.Property.AnchorPoint))
-                {
-                    using (Position position = new Position(0.0f, 0.0f, 0.0f))
-                    { 
-                        anchorPoint?.Get(position);
-                        return new Position(OnAnchorPointChanged, position.X, position.Y, position.Z);
-                    }
-                }
+                Position temp = new Position(0.0f, 0.0f, 0.0f);
+                GetProperty(View.Property.AnchorPoint).Get(temp);
+                return new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
             }
             set
             {
-                using (PropertyValue setValue = new Tizen.NUI.PropertyValue(value))
-                {
-                    SetProperty(View.Property.AnchorPoint, setValue);
-                    NotifyPropertyChanged();
-                }
+                SetProperty(View.Property.AnchorPoint, new Tizen.NUI.PropertyValue(value));
+                NotifyPropertyChanged();
             }
         }
 
@@ -1946,11 +1896,8 @@ namespace Tizen.NUI.BaseComponents
 
                 if (basehandle is Layer layer)
                 {
-                    using (View view = new View(Layer.getCPtr(layer).Handle, false))
-                    {
-                        ret = view;
-                        NUILog.Error("This Parent property is deprecated, shoud do not be used");
-                    }
+                    ret = new View(Layer.getCPtr(layer).Handle, false);
+                    NUILog.Error("This Parent property is deprecated, shoud do not be used");
                 }
                 else
                 {
@@ -2171,23 +2118,15 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                using (PropertyValue padding = GetProperty(View.Property.PADDING))
-                {
-                    using (Extents extents = new Extents(0, 0, 0, 0))
-                    {
-                        padding?.Get(extents);
-                        return new Extents(OnPaddingEXChanged, extents.Start, extents.End, extents.Top, extents.Bottom);
-                    }
-                }
+                Extents temp = new Extents(0, 0, 0, 0);
+                GetProperty(View.Property.PADDING).Get(temp);
+                return new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
             }
             set
             {
-                using (PropertyValue setValue = new Tizen.NUI.PropertyValue(value))
-                {
-                    SetProperty(View.Property.PADDING, setValue);
-                    NotifyPropertyChanged();
-                    layout?.RequestLayout();
-                }
+                SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value));
+                NotifyPropertyChanged();
+                layout?.RequestLayout();
             }
         }
 
@@ -2342,19 +2281,13 @@ namespace Tizen.NUI.BaseComponents
                 backgroundImageSynchronosLoading = value;
 
                 string bgUrl = null;
-                using (PropertyValue url = Background.Find(ImageVisualProperty.URL))
-                {
-                    url?.Get(out bgUrl);
-                }
+                Background.Find(ImageVisualProperty.URL)?.Get(out bgUrl);
 
                 if (!string.IsNullOrEmpty(bgUrl))
                 {
                     PropertyMap bgMap = this.Background;
-                    using (PropertyValue addedProperty = new PropertyValue(backgroundImageSynchronosLoading))
-                    {
-                        bgMap.Add("synchronousLoading", addedProperty);
-                        Background = bgMap;
-                    }
+                    bgMap.Add("synchronousLoading", new PropertyValue(backgroundImageSynchronosLoading));
+                    Background = bgMap;
                 }
             }
         }
@@ -2437,20 +2370,14 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                using (PropertyValue captureAllTouch = GetProperty(View.Property.CaptureAllTouchAfterStart))
-                {
-                    bool isGrabTouch = false;
-                    captureAllTouch?.Get(out isGrabTouch);
-                    return isGrabTouch;
-                }
+                bool temp = false;
+                GetProperty(View.Property.CaptureAllTouchAfterStart).Get(out temp);
+                return temp;
             }
             set
             {
-                using (PropertyValue setValue = new Tizen.NUI.PropertyValue(value))
-                {
-                    SetProperty(View.Property.CaptureAllTouchAfterStart, setValue);
-                    NotifyPropertyChanged();
-                }
+                SetProperty(View.Property.CaptureAllTouchAfterStart, new Tizen.NUI.PropertyValue(value));
+                NotifyPropertyChanged();
             }
         }
 
@@ -2464,20 +2391,14 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                using (PropertyValue blendEquation = GetProperty(View.Property.BlendEquation))
-                {
-                    int type = 0;
-                    blendEquation?.Get(out type);
-                    return (BlendEquationType)type;
-                }
+                int temp = 0;
+                GetProperty(View.Property.BlendEquation).Get(out temp);
+                return (BlendEquationType)temp;
             }
             set
             {
-                using (PropertyValue setValue = new Tizen.NUI.PropertyValue((int)value))
-                {
-                    SetProperty(View.Property.BlendEquation, setValue);
-                    NotifyPropertyChanged();
-                }
+                SetProperty(View.Property.BlendEquation, new Tizen.NUI.PropertyValue((int)value));
+                NotifyPropertyChanged();
             }
         }