[NUI] Fix CA1052
authorJiyun Yang <ji.yang@samsung.com>
Wed, 9 Dec 2020 05:49:11 +0000 (14:49 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 15 Dec 2020 06:33:59 +0000 (15:33 +0900)
CA1052
Static holder types should be Static or NotInheritable.

This patch fixes classes that holds only static members to static or sealed.
If the class is obsolete, added suppress message attribute to hide warnings.

Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
12 files changed:
src/Tizen.NUI/src/internal/Application.cs
src/Tizen.NUI/src/internal/FrameBuffer.cs
src/Tizen.NUI/src/internal/ItemView.cs
src/Tizen.NUI/src/public/BaseComponents/FlexContainer.cs
src/Tizen.NUI/src/public/BaseComponents/Scrollable.cs
src/Tizen.NUI/src/public/ImageLoading.cs
src/Tizen.NUI/src/public/NUIApplication.cs
src/Tizen.NUI/src/public/Renderer.cs
src/Tizen.NUI/src/public/Shader.cs
src/Tizen.NUI/src/public/UIComponents/ScrollView.cs
src/Tizen.NUI/src/public/UIComponents/ToggleButton.cs
src/Tizen.NUI/src/public/Utility/GraphicsCapabilities.cs

index 40099e0..8ad6f0d 100755 (executable)
@@ -287,7 +287,7 @@ namespace Tizen.NUI
     /// <summary>
     /// A class to get resources in current application.
     /// </summary>
-    public class GetResourcesProvider
+    public sealed class GetResourcesProvider
     {
         /// <summary>
         /// Get resources in current application.
index ffa3be3..1b683b1 100755 (executable)
@@ -39,7 +39,7 @@ namespace Tizen.NUI
         }
 
         /// <since_tizen> 3 </since_tizen>
-        public class Attachment
+        public sealed class Attachment
         {
             /// <since_tizen> 3 </since_tizen>
             public enum Mask
index 46b00b8..918faf0 100755 (executable)
@@ -16,6 +16,7 @@
  */
 
 using System;
+using System.Diagnostics.CodeAnalysis;
 using System.Runtime.InteropServices;
 using Tizen.NUI.BaseComponents;
 using System.ComponentModel;
@@ -62,6 +63,7 @@ namespace Tizen.NUI
         /// <summary>
         /// Property for ItemView. This is internal use only, so not recommended to use. Need to use ItemView's properties.
         /// </summary>
+        [SuppressMessage("Microsoft.Design", "CA1052:StaticHolderTypesShouldBeStaticOrNotInheritable")]
         [Obsolete("Deprecated in API6; Will be removed in API9.")]
         [EditorBrowsable(EditorBrowsableState.Never)]
         public new class Property
index aa374ae..dd0671e 100755 (executable)
@@ -16,6 +16,7 @@
  */
 using System;
 using System.ComponentModel;
+using System.Diagnostics.CodeAnalysis;
 using Tizen.NUI.Binding;
 
 namespace Tizen.NUI.BaseComponents
@@ -432,6 +433,7 @@ namespace Tizen.NUI.BaseComponents
         /// Enumeration for the instance of child properties belonging to the FlexContainer class.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
+        [SuppressMessage("Microsoft.Design", "CA1052:StaticHolderTypesShouldBeStaticOrNotInheritable")]
         [Obsolete("Deprecated in API6, Will be removed in API9, " +
             "Please use View.Flex, View.AlignSelf, View.FlexMargin instead!")]
         [EditorBrowsable(EditorBrowsableState.Never)]
index 6e21cbe..254e148 100755 (executable)
@@ -15,6 +15,7 @@
  *
  */
 using System;
+using System.Diagnostics.CodeAnalysis;
 using System.ComponentModel;
 using System.Runtime.InteropServices;
 using Tizen.NUI.Binding;
@@ -746,6 +747,7 @@ namespace Tizen.NUI.BaseComponents
         /// Enumeration for the instance of properties belonging to the Scrollable class.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
+        [SuppressMessage("Microsoft.Design", "CA1052:StaticHolderTypesShouldBeStaticOrNotInheritable")]
         [EditorBrowsable(EditorBrowsableState.Never)]
         [Obsolete("Deprecated in API6; Will be removed in API9.")]
         public new class Property
index 92e8983..f06829b 100755 (executable)
@@ -26,7 +26,7 @@ namespace Tizen.NUI
     /// <since_tizen> 5 </since_tizen>
     /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
     [EditorBrowsable(EditorBrowsableState.Never)]
-    public class ImageLoading
+    public static class ImageLoading
     {
         /// <summary>
         /// Load an image synchronously from local file.
index 912e3f3..712336d 100755 (executable)
@@ -17,6 +17,7 @@
 
 using System;
 using System.ComponentModel;
+using System.Diagnostics.CodeAnalysis;
 using System.Threading;
 using System.Reflection;
 using Tizen.Applications;
@@ -416,6 +417,7 @@ namespace Tizen.NUI
     /// <summary>
     /// Graphics Backend Type.
     /// </summary>
+    [SuppressMessage("Microsoft.Design", "CA1052:StaticHolderTypesShouldBeStaticOrNotInheritable")]
     [EditorBrowsable(EditorBrowsableState.Never)]
     [Obsolete("Please do not use! This will be deprecated!")]
     public class Graphics
index 9a083b8..dbefaee 100755 (executable)
@@ -16,6 +16,7 @@
  */
 using System;
 using System.ComponentModel;
+using System.Diagnostics.CodeAnalysis;
 using System.Runtime.InteropServices;
 
 namespace Tizen.NUI
@@ -582,11 +583,10 @@ namespace Tizen.NUI
             Interop.Renderer.DeleteRenderer(swigCPtr);
         }
 
-
         /// <since_tizen> 6.0 </since_tizen>
         /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public class Ranges
+        public sealed class Ranges
         {
             /// <since_tizen> 6.0 </since_tizen>
             /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API.
@@ -618,6 +618,7 @@ namespace Tizen.NUI
         /// Enumeration for instances of properties belonging to the Renderer class.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
+        [SuppressMessage("Microsoft.Design", "CA1052:StaticHolderTypesShouldBeStaticOrNotInheritable")]
         [EditorBrowsable(EditorBrowsableState.Never)]
         [Obsolete("Deprecated in API6; Will be removed in API9.")]
         public class Property
index 3e4aef0..3699985 100755 (executable)
@@ -15,6 +15,7 @@
  *
  */
 using System;
+using System.Diagnostics.CodeAnalysis;
 using System.ComponentModel;
 
 namespace Tizen.NUI
@@ -87,7 +88,7 @@ namespace Tizen.NUI
         /// Hint.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        public class Hint
+        public sealed class Hint
         {
             /// <summary>
             /// Enumeration for the hint value.
@@ -119,6 +120,7 @@ namespace Tizen.NUI
         /// Enumeration for instances of properties belonging to the Shader class.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
+        [SuppressMessage("Microsoft.Design", "CA1052:StaticHolderTypesShouldBeStaticOrNotInheritable")]
         [EditorBrowsable(EditorBrowsableState.Never)]
         [Obsolete("Deprecated in API6; Will be removed in API9.")]
         public class Property
index 7114bc4..4d457b7 100755 (executable)
@@ -17,6 +17,7 @@
 
 using System;
 using System.ComponentModel;
+using System.Diagnostics.CodeAnalysis;
 using Tizen.NUI.BaseComponents;
 
 namespace Tizen.NUI
@@ -1246,6 +1247,7 @@ namespace Tizen.NUI
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         /// This will be deprecated
+        [SuppressMessage("Microsoft.Design", "CA1052:StaticHolderTypesShouldBeStaticOrNotInheritable")]
         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
         [EditorBrowsable(EditorBrowsableState.Never)]
         public new class Property
index 1fe6150..eb70e0c 100755 (executable)
@@ -16,6 +16,7 @@
  */
 using System;
 using System.ComponentModel;
+using System.Diagnostics.CodeAnalysis;
 using Tizen.NUI.Binding;
 
 namespace Tizen.NUI
@@ -174,6 +175,7 @@ namespace Tizen.NUI
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         /// This will be deprecated
+        [SuppressMessage("Microsoft.Design", "CA1052:StaticHolderTypesShouldBeStaticOrNotInheritable")]
         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
         [EditorBrowsable(EditorBrowsableState.Never)]
         public new class Property
index 0c27eb5..9e8d41a 100755 (executable)
@@ -21,7 +21,7 @@ namespace Tizen.NUI
 {
     /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
     [EditorBrowsable (EditorBrowsableState.Never)]
-    public class GraphicsCapabilities
+    public static class GraphicsCapabilities
     {
         [EditorBrowsable (EditorBrowsableState.Never)]
         public static bool IsBlendEquationSupported(BlendEquationType blendEquation)