Revert "[NUI] Fix CA2000 Warnings"
authorJiyun Yang <ji.yang@samsung.com>
Thu, 7 Jan 2021 12:40:19 +0000 (21:40 +0900)
committerhuiyueun <35286162+huiyueun@users.noreply.github.com>
Mon, 11 Jan 2021 05:49:43 +0000 (14:49 +0900)
This reverts commit 92f2d926ec881a0ccacd447401526dcd19cf01b0.

src/Tizen.NUI/src/public/LongPressGestureDetector.cs
src/Tizen.NUI/src/public/PanGestureDetector.cs
src/Tizen.NUI/src/public/PinchGestureDetector.cs
src/Tizen.NUI/src/public/PropertyNotification.cs
src/Tizen.NUI/src/public/RotationGestureDetector.cs
src/Tizen.NUI/src/public/Shader.cs
src/Tizen.NUI/src/public/StyleManager.cs
src/Tizen.NUI/src/public/TTSPlayer.cs
src/Tizen.NUI/src/public/TapGestureDetector.cs
src/Tizen.NUI/src/public/Timer.cs
src/Tizen.NUI/src/public/Utility/TextPageUtil.cs

index 09bae0a31cae39fc0eb69e6b760638af9e829a95..632b1fb35953e0687b291ea42c573bb88eca29c9 100755 (executable)
@@ -85,7 +85,6 @@ namespace Tizen.NUI
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
         private delegate void DetectedCallbackType(IntPtr actor, IntPtr longPressGesture);
         private DetectedCallbackType _detectedCallback;
-        private LongPressGestureDetectedSignal detectedSignal;
 
         /// <summary>
         /// This signal is emitted when the specified long press is detected on the attached view.
@@ -99,8 +98,7 @@ namespace Tizen.NUI
                 if (_detectedEventHandler == null)
                 {
                     _detectedCallback = OnLongPressGestureDetected;
-                    detectedSignal = DetectedSignal();
-                    detectedSignal.Connect(_detectedCallback);
+                    DetectedSignal().Connect(_detectedCallback);
                 }
 
                 _detectedEventHandler += value;
@@ -110,11 +108,9 @@ namespace Tizen.NUI
             {
                 _detectedEventHandler -= value;
 
-                if (_detectedEventHandler == null && detectedSignal?.Empty() == false)
+                if (_detectedEventHandler == null && DetectedSignal().Empty() == false)
                 {
-                    detectedSignal.Disconnect(_detectedCallback);
-                    detectedSignal.Dispose();
-                    detectedSignal = null;
+                    DetectedSignal().Disconnect(_detectedCallback);
                 }
             }
         }
@@ -208,11 +204,9 @@ namespace Tizen.NUI
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
         {
-            if (_detectedEventHandler == null && detectedSignal?.Empty() == false)
+            if (_detectedEventHandler == null && DetectedSignal().Empty() == false)
             {
-                detectedSignal.Disconnect(_detectedCallback);
-                detectedSignal.Dispose();
-                detectedSignal = null;
+                DetectedSignal().Disconnect(_detectedCallback);
             }
             Interop.LongPressGestureDetector.DeleteLongPressGestureDetector(swigCPtr);
         }
index 3fa4db3b1aa0e8d966037ec3cc1e7d03e96a60ab..05bbf89cc1f18eb661352267cd8fa4b0fadc9b46 100755 (executable)
@@ -58,7 +58,6 @@ namespace Tizen.NUI
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
         private delegate void DetectedCallbackType(IntPtr actor, IntPtr panGesture);
         private DetectedCallbackType _detectedCallback;
-        private PanGestureDetectedSignal detectedSignal;
 
         /// <summary>
         /// This signal is emitted when the specified pan is detected on the attached view.
@@ -72,8 +71,7 @@ namespace Tizen.NUI
                 if (_detectedEventHandler == null)
                 {
                     _detectedCallback = OnPanGestureDetected;
-                    detectedSignal = DetectedSignal();
-                    detectedSignal.Connect(_detectedCallback);
+                    DetectedSignal().Connect(_detectedCallback);
                 }
 
                 _detectedEventHandler += value;
@@ -83,11 +81,9 @@ namespace Tizen.NUI
             {
                 _detectedEventHandler -= value;
 
-                if (_detectedEventHandler == null && detectedSignal?.Empty() == false)
+                if (_detectedEventHandler == null && DetectedSignal().Empty() == false)
                 {
-                    detectedSignal.Disconnect(_detectedCallback);
-                    detectedSignal.Dispose();
-                    detectedSignal = null;
+                    DetectedSignal().Disconnect(_detectedCallback);
                 }
             }
         }
@@ -229,9 +225,7 @@ namespace Tizen.NUI
             get
             {
                 Vector2 temp = new Vector2(0.0f, 0.0f);
-                var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, PanGestureDetector.Property.ScreenDisplacement);
-                pValue.Get(temp);
-                pValue.Dispose();
+                Tizen.NUI.Object.GetProperty(SwigCPtr, PanGestureDetector.Property.ScreenDisplacement).Get(temp);
                 return temp;
             }
         }
@@ -246,9 +240,7 @@ namespace Tizen.NUI
             get
             {
                 Vector2 temp = new Vector2(0.0f, 0.0f);
-                var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, PanGestureDetector.Property.ScreenVelocity);
-                pValue.Get(temp);
-                pValue.Dispose();
+                Tizen.NUI.Object.GetProperty(SwigCPtr, PanGestureDetector.Property.ScreenVelocity).Get(temp);
                 return temp;
             }
         }
@@ -263,9 +255,7 @@ namespace Tizen.NUI
             get
             {
                 Vector2 temp = new Vector2(0.0f, 0.0f);
-                var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, PanGestureDetector.Property.LocalPosition);
-                pValue.Get(temp);
-                pValue.Dispose();
+                Tizen.NUI.Object.GetProperty(SwigCPtr, PanGestureDetector.Property.LocalPosition).Get(temp);
                 return temp;
             }
         }
@@ -280,9 +270,7 @@ namespace Tizen.NUI
             get
             {
                 Vector2 temp = new Vector2(0.0f, 0.0f);
-                var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, PanGestureDetector.Property.LocalDisplacement);
-                pValue.Get(temp);
-                pValue.Dispose();
+                Tizen.NUI.Object.GetProperty(SwigCPtr, PanGestureDetector.Property.LocalDisplacement).Get(temp);
                 return temp;
             }
         }
@@ -297,9 +285,7 @@ namespace Tizen.NUI
             get
             {
                 Vector2 temp = new Vector2(0.0f, 0.0f);
-                var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, PanGestureDetector.Property.LocalVelocity);
-                pValue.Get(temp);
-                pValue.Dispose();
+                Tizen.NUI.Object.GetProperty(SwigCPtr, PanGestureDetector.Property.LocalVelocity).Get(temp);
                 return temp;
             }
         }
@@ -314,9 +300,7 @@ namespace Tizen.NUI
             get
             {
                 bool temp = false;
-                var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, PanGestureDetector.Property.PANNING);
-                pValue.Get(out temp);
-                pValue.Dispose();
+                Tizen.NUI.Object.GetProperty(SwigCPtr, PanGestureDetector.Property.PANNING).Get(out temp);
                 return temp;
             }
         }
@@ -535,8 +519,7 @@ namespace Tizen.NUI
         {
             if (_detectedCallback != null)
             {
-                detectedSignal?.Disconnect(_detectedCallback);
-                detectedSignal?.Dispose();
+                DetectedSignal().Disconnect(_detectedCallback);
             }
 
             Interop.PanGestureDetector.DeletePanGestureDetector(swigCPtr);
index a0932cdef31bcffdfd96fff84f0acb42e434adb5..f8fdb00814ede3832f4667ada61c06f7bde735f2 100755 (executable)
@@ -58,7 +58,6 @@ namespace Tizen.NUI
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
         private delegate void DetectedCallbackType(IntPtr actor, IntPtr pinchGesture);
         private DetectedCallbackType _detectedCallback;
-        private PinchGestureDetectedSignal detectedSignal;
 
         /// <summary>
         /// This signal is emitted when the specified pinch is detected on the attached view.
@@ -72,8 +71,7 @@ namespace Tizen.NUI
                 if (_detectedEventHandler == null)
                 {
                     _detectedCallback = OnPinchGestureDetected;
-                    detectedSignal = DetectedSignal();
-                    detectedSignal.Connect(_detectedCallback);
+                    DetectedSignal().Connect(_detectedCallback);
                 }
 
                 _detectedEventHandler += value;
@@ -83,11 +81,9 @@ namespace Tizen.NUI
             {
                 _detectedEventHandler -= value;
 
-                if (_detectedEventHandler == null && detectedSignal?.Empty() == false)
+                if (_detectedEventHandler == null && DetectedSignal().Empty() == false)
                 {
-                    detectedSignal.Disconnect(_detectedCallback);
-                    detectedSignal.Dispose();
-                    detectedSignal = null;
+                    DetectedSignal().Disconnect(_detectedCallback);
                 }
             }
         }
@@ -132,8 +128,7 @@ namespace Tizen.NUI
         {
             if (_detectedCallback != null)
             {
-                detectedSignal?.Disconnect(_detectedCallback);
-                detectedSignal?.Dispose();
+                DetectedSignal().Disconnect(_detectedCallback);
             }
 
             Interop.PinchGesture.DeletePinchGestureDetector(swigCPtr);
index 4a5ffff1feb378023f76c3a11375cb99a03d5c2a..48eea3e0ee10e232e09516e48cbb46fef05f88fa 100755 (executable)
@@ -31,7 +31,6 @@ namespace Tizen.NUI
 
         private DaliEventHandler<object, NotifyEventArgs> _propertyNotificationNotifyEventHandler;
         private NotifyEventCallbackDelegate _propertyNotificationNotifyEventCallbackDelegate;
-        private PropertyNotifySignal notifySignal;
 
         /// <summary>
         /// Create a instance of PropertyNotification.
@@ -73,8 +72,7 @@ namespace Tizen.NUI
                     _propertyNotificationNotifyEventHandler += value;
 
                     _propertyNotificationNotifyEventCallbackDelegate = new NotifyEventCallbackDelegate(OnPropertyNotificationNotify);
-                    notifySignal = this.NotifySignal();
-                    notifySignal.Connect(_propertyNotificationNotifyEventCallbackDelegate);
+                    this.NotifySignal().Connect(_propertyNotificationNotifyEventCallbackDelegate);
                 }
             }
 
@@ -82,9 +80,7 @@ namespace Tizen.NUI
             {
                 if (_propertyNotificationNotifyEventHandler != null)
                 {
-                    notifySignal?.Disconnect(_propertyNotificationNotifyEventCallbackDelegate);
-                    notifySignal?.Dispose();
-                    notifySignal = null;
+                    this.NotifySignal().Disconnect(_propertyNotificationNotifyEventCallbackDelegate);
                 }
 
                 _propertyNotificationNotifyEventHandler -= value;
index 291f1018fab8995bb56efbfa546bab1a1e960d9d..43a06da64aff009e7250e7bb0d55a642469533ce 100755 (executable)
@@ -58,7 +58,6 @@ namespace Tizen.NUI
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
         private delegate void DetectedCallbackType(IntPtr actor, IntPtr rotationGesture);
         private DetectedCallbackType _detectedCallback;
-        private RotationGestureDetectedSignal detectedSignal;
 
         /// <summary>
         /// This signal is emitted when the specified rotation is detected on the attached view.
@@ -72,8 +71,7 @@ namespace Tizen.NUI
                 if (_detectedEventHandler == null)
                 {
                     _detectedCallback = OnRotationGestureDetected;
-                    detectedSignal = DetectedSignal();
-                    detectedSignal.Connect(_detectedCallback);
+                    DetectedSignal().Connect(_detectedCallback);
                 }
 
                 _detectedEventHandler += value;
@@ -83,11 +81,9 @@ namespace Tizen.NUI
             {
                 _detectedEventHandler -= value;
 
-                if (_detectedEventHandler == null && detectedSignal?.Empty() == false)
+                if (_detectedEventHandler == null && DetectedSignal().Empty() == false)
                 {
-                    detectedSignal.Disconnect(_detectedCallback);
-                    detectedSignal.Dispose();
-                    detectedSignal = null;
+                    DetectedSignal().Disconnect(_detectedCallback);
                 }
             }
         }
@@ -132,8 +128,7 @@ namespace Tizen.NUI
         {
             if (_detectedCallback != null)
             {
-                detectedSignal?.Disconnect(_detectedCallback);
-                detectedSignal?.Dispose();
+                DetectedSignal().Disconnect(_detectedCallback);
             }
 
             Interop.RotationGesture.DeleteRotationGestureDetector(swigCPtr);
index e970b57c58aa6593a038098ef83f72801739bb3f..424f0f51b1694032efad3eeba2cb688cec37ada4 100755 (executable)
@@ -59,16 +59,12 @@ namespace Tizen.NUI
             get
             {
                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
-                var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, Shader.Property.PROGRAM);
-                pValue.Get(temp);
-                pValue.Dispose();
+                Tizen.NUI.Object.GetProperty(SwigCPtr, Shader.Property.PROGRAM).Get(temp);
                 return temp;
             }
             set
             {
-                var temp = new Tizen.NUI.PropertyValue(value);
-                Tizen.NUI.Object.SetProperty(SwigCPtr, Shader.Property.PROGRAM, temp);
-                temp.Dispose();
+                Tizen.NUI.Object.SetProperty(SwigCPtr, Shader.Property.PROGRAM, new Tizen.NUI.PropertyValue(value));
             }
         }
 
index 75ed880e9948fb60f3d34a7908953dd37f99b7d6..b6818151b21a7d7543b50349468b8d427603b13b 100755 (executable)
@@ -35,7 +35,6 @@ namespace Tizen.NUI
         private static readonly StyleManager instance = StyleManager.Get();
         private EventHandler<StyleChangedEventArgs> _styleManagerStyleChangedEventHandler;
         private StyleChangedCallbackDelegate _styleManagerStyleChangedCallbackDelegate;
-        private StyleChangedSignal styleChangedSignal;
 
         /// <summary>
         /// Creates a StyleManager handle.<br />
@@ -64,19 +63,16 @@ namespace Tizen.NUI
                 if (_styleManagerStyleChangedEventHandler == null)
                 {
                     _styleManagerStyleChangedCallbackDelegate = (OnStyleChanged);
-                    styleChangedSignal = StyleChangedSignal();
-                    styleChangedSignal.Connect(_styleManagerStyleChangedCallbackDelegate);
+                    StyleChangedSignal().Connect(_styleManagerStyleChangedCallbackDelegate);
                 }
                 _styleManagerStyleChangedEventHandler += value;
             }
             remove
             {
                 _styleManagerStyleChangedEventHandler -= value;
-                if (_styleManagerStyleChangedEventHandler == null && styleChangedSignal?.Empty() == false)
+                if (_styleManagerStyleChangedEventHandler == null && StyleChangedSignal().Empty() == false)
                 {
-                    styleChangedSignal.Disconnect(_styleManagerStyleChangedCallbackDelegate);
-                    styleChangedSignal.Dispose();
-                    styleChangedSignal = null;
+                    StyleChangedSignal().Disconnect(_styleManagerStyleChangedCallbackDelegate);
                 }
             }
         }
index 4baa611a562e0ba9c670a5339e7db303883ee610..30b874b8fb10345ac81f23d8e75068190957f451 100755 (executable)
@@ -29,7 +29,6 @@ namespace Tizen.NUI
     {
         private static readonly TTSPlayer instance = TTSPlayer.Get();
         private StateChangedEventCallbackType _stateChangedEventCallback;
-        private StateChangedSignalType stateChangedSignal;
 
         internal TTSPlayer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.TtsPlayer.Upcast(cPtr), cMemoryOwn)
         {
@@ -60,8 +59,7 @@ namespace Tizen.NUI
                 if (_stateChangedEventHandler == null)
                 {
                     _stateChangedEventCallback = OnStateChanged;
-                    stateChangedSignal = StateChangedSignal();
-                    stateChangedSignal.Connect(_stateChangedEventCallback);
+                    StateChangedSignal().Connect(_stateChangedEventCallback);
                 }
 
                 _stateChangedEventHandler += value;
@@ -70,11 +68,9 @@ namespace Tizen.NUI
             {
                 _stateChangedEventHandler -= value;
 
-                if (_stateChangedEventHandler == null && stateChangedSignal?.Empty() == false && _stateChangedEventCallback != null)
+                if (_stateChangedEventHandler == null && StateChangedSignal().Empty() == false && _stateChangedEventCallback != null)
                 {
-                    stateChangedSignal.Disconnect(_stateChangedEventCallback);
-                    stateChangedSignal.Dispose();
-                    stateChangedSignal = null;
+                    StateChangedSignal().Disconnect(_stateChangedEventCallback);
                 }
             }
         }
index 25ef8a7ca9ba8dc7aaec8c6d566bfee16dada65e..9971fbdcb1710c639d3067b9423c9a99db1bc778 100755 (executable)
@@ -60,7 +60,6 @@ namespace Tizen.NUI
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
         private delegate void DetectedCallbackType(IntPtr actor, IntPtr TapGesture);
         private DetectedCallbackType _detectedCallback;
-        private TapGestureDetectedSignal detectedSignal;
 
         /// <summary>
         /// This signal is emitted when the specified tap is detected on the attached view.
@@ -74,8 +73,7 @@ namespace Tizen.NUI
                 if (_detectedEventHandler == null)
                 {
                     _detectedCallback = OnTapGestureDetected;
-                    detectedSignal = DetectedSignal();
-                    detectedSignal.Connect(_detectedCallback);
+                    DetectedSignal().Connect(_detectedCallback);
                 }
 
                 _detectedEventHandler += value;
@@ -85,11 +83,9 @@ namespace Tizen.NUI
             {
                 _detectedEventHandler -= value;
 
-                if (_detectedEventHandler == null && detectedSignal?.Empty() == false)
+                if (_detectedEventHandler == null && DetectedSignal().Empty() == false)
                 {
-                    detectedSignal.Disconnect(_detectedCallback);
-                    detectedSignal.Dispose();
-                    detectedSignal = null;
+                    DetectedSignal().Disconnect(_detectedCallback);
                 }
             }
         }
@@ -196,8 +192,7 @@ namespace Tizen.NUI
         {
             if (_detectedCallback != null)
             {
-                detectedSignal?.Disconnect(_detectedCallback);
-                detectedSignal?.Dispose();
+                DetectedSignal().Disconnect(_detectedCallback);
             }
 
             Interop.TapGestureDetector.DeleteTapGestureDetector(swigCPtr);
index 75d00e2a78ea82a993be4a96b6d5d48192b41f54..df48769794824fe0ae451c9f59c43f6a114e4bd7 100755 (executable)
@@ -38,7 +38,7 @@ namespace Tizen.NUI
         private bool played = false;
         private EventHandlerWithReturnType<object, TickEventArgs, bool> _timerTickEventHandler;
         private TickCallbackDelegate _timerTickCallbackDelegate;
-        private TimerSignalType tickSignal;
+
         private System.IntPtr _timerTickCallbackOfNative;
 
         /// <summary>
@@ -89,19 +89,16 @@ namespace Tizen.NUI
             {
                 if (_timerTickEventHandler == null && disposed == false)
                 {
-                    tickSignal = TickSignal();
-                    tickSignal.Connect(_timerTickCallbackOfNative);
+                    TickSignal().Connect(_timerTickCallbackOfNative);
                 }
                 _timerTickEventHandler += value;
             }
             remove
             {
                 _timerTickEventHandler -= value;
-                if (_timerTickEventHandler == null && tickSignal?.Empty() == false)
+                if (_timerTickEventHandler == null && TickSignal().Empty() == false)
                 {
-                    tickSignal.Disconnect(_timerTickCallbackOfNative);
-                    tickSignal.Dispose();
-                    tickSignal = null;
+                    TickSignal().Disconnect(_timerTickCallbackOfNative);
                 }
             }
         }
@@ -273,8 +270,7 @@ namespace Tizen.NUI
 
             if (this != null && _timerTickCallbackDelegate != null)
             {
-                tickSignal?.Disconnect(_timerTickCallbackOfNative);
-                tickSignal?.Dispose();
+                TickSignal().Disconnect(_timerTickCallbackOfNative);
             }
 
             if (disposed)
index f410d556fd73a31cda24fe3cc0ee7a19d32f7cfe..7aa78b2b3849aaf822a2550c3dfb4ed1dfb7857d 100755 (executable)
@@ -131,9 +131,7 @@ namespace Tizen.NUI.Utility
             uint count = cutOffIndexArray.Count();
             for (uint i = 0; i < count; i++)
             {
-                PropertyValue temp = cutOffIndexArray.GetElementAt(i);
-                temp.Get(out cutOffIndex); // Gets the last index of text shown on the actual screen.
-                temp.Dispose();
+                cutOffIndexArray.GetElementAt(i).Get(out cutOffIndex); // Gets the last index of text shown on the actual screen.
 
                 // If markup is enabled, It should parse markup
                 if (label.EnableMarkup)