diff --git a/src/Microsoft.DotNet.Wpf/src/.editorconfig b/src/Microsoft.DotNet.Wpf/src/.editorconfig index b435e7e8340..93cf5d86826 100644 --- a/src/Microsoft.DotNet.Wpf/src/.editorconfig +++ b/src/Microsoft.DotNet.Wpf/src/.editorconfig @@ -17,9 +17,6 @@ csharp_style_pattern_matching_over_as_with_null_check = true:suggestion # CA1036: Override methods on comparable types dotnet_diagnostic.CA1036.severity = suggestion -# CA1052: Static holder types should be Static or NotInheritable -dotnet_diagnostic.CA1052.severity = suggestion - # NOTE: If existing public API, CA1066 should be suppressed individually # in the GlobalSuppressions file. diff --git a/src/Microsoft.DotNet.Wpf/src/Common/Graphics/wgx_core_types.cs b/src/Microsoft.DotNet.Wpf/src/Common/Graphics/wgx_core_types.cs index fdcc9e59814..8f556b9079f 100644 --- a/src/Microsoft.DotNet.Wpf/src/Common/Graphics/wgx_core_types.cs +++ b/src/Microsoft.DotNet.Wpf/src/Common/Graphics/wgx_core_types.cs @@ -780,7 +780,7 @@ internal enum MILCMD #endif }; - internal partial class DUCE + internal static partial class DUCE { // // The MILCE resource type enumeration. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/Win32/UnsafeNativeMethodsPointer.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/Win32/UnsafeNativeMethodsPointer.cs index 42c53833205..9eeacd6cb5a 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/Win32/UnsafeNativeMethodsPointer.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/Win32/UnsafeNativeMethodsPointer.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. @@ -14,7 +14,7 @@ namespace MS.Win32.Pointer /// For WM_POINTER /// For InteractionContext /// - internal class UnsafeNativeMethods + internal static class UnsafeNativeMethods { #region Enumerations diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Ink/InkSerializedFormat/Compress.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Ink/InkSerializedFormat/Compress.cs index f91776dfc57..8142019902f 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Ink/InkSerializedFormat/Compress.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Ink/InkSerializedFormat/Compress.cs @@ -1,11 +1,11 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. //#define OLD_ISF namespace MS.Internal.Ink.InkSerializedFormat { - internal class Compressor + internal static class Compressor #if OLD_ISF : IDisposable #endif diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/MediaTrace.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/MediaTrace.cs index 0905e2df0a3..782acd6f1f3 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/MediaTrace.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/MediaTrace.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace MS.Internal @@ -25,7 +25,7 @@ internal class MediaTrace : IDisposable public static MediaTrace QueueItems = new MediaTrace("MILQueueItems"); public static MediaTrace Statistics = new MediaTrace("Statistics"); - public class ChangeQueue + public static class ChangeQueue { public static MediaTrace ApplyChange = new MediaTrace("Change queue: Apply Change"); public static MediaTrace Enqueue = new MediaTrace("Change queue: Enqueue"); diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Pointer/PointerStylusPointPropertyInfoHelper.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Pointer/PointerStylusPointPropertyInfoHelper.cs index 0790bef4187..f0a5d7ce111 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Pointer/PointerStylusPointPropertyInfoHelper.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Pointer/PointerStylusPointPropertyInfoHelper.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. @@ -9,7 +9,7 @@ namespace System.Windows.Input.StylusPointer /// /// Contains a WM_POINTER specific functions to parse out stylus property info /// - internal class PointerStylusPointPropertyInfoHelper + internal static class PointerStylusPointPropertyInfoHelper { #region Constants diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Annotations/Anchoring/TextSelectionHelper.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Annotations/Anchoring/TextSelectionHelper.cs index cf65fc8df85..8ad2ec7d5b4 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Annotations/Anchoring/TextSelectionHelper.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Annotations/Anchoring/TextSelectionHelper.cs @@ -26,24 +26,9 @@ namespace MS.Internal.Annotations.Anchoring /// represent these TextAnchors and can generate TextAnchors from /// the locator parts. /// - internal class TextSelectionHelper + internal static class TextSelectionHelper { - //------------------------------------------------------ - // - // Constructors - // - //------------------------------------------------------ - - #region Constructors - - /// - /// This ctor is added to prevent the compiler from - /// generating a public default ctor. This class - /// should not be instantiated - /// - private TextSelectionHelper() { } - #endregion Constructors //------------------------------------------------------ // diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Controls/ActiveXHelper.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Controls/ActiveXHelper.cs index de5af841202..56dec155533 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Controls/ActiveXHelper.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Controls/ActiveXHelper.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // @@ -19,7 +19,7 @@ namespace MS.Internal.Controls // It also has types that make sense only for ActiveX hosting classes. // In other words, this is a helper class for the ActiveX hosting classes. // - internal class ActiveXHelper + internal static class ActiveXHelper { // // Types: @@ -56,11 +56,6 @@ public enum ActiveXState private static int logPixelsY = -1; private const int HMperInch = 2540; - // Prevent compiler from generating public CTOR - private ActiveXHelper() - { - } - // // Static helper methods: // diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/WindowsRuntime/Generated/WinRT/ExceptionHelpers.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/WindowsRuntime/Generated/WinRT/ExceptionHelpers.cs index 25884314e1e..90e3f4020ce 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/WindowsRuntime/Generated/WinRT/ExceptionHelpers.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/WindowsRuntime/Generated/WinRT/ExceptionHelpers.cs @@ -372,7 +372,7 @@ internal static Exception GetExceptionForHR(this Exception innerException, int h } } - internal class ErrorStrings + internal static class ErrorStrings { internal static string Format(string format, params object[] args) => String.Format(format, args); diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/WindowsRuntime/Generated/WinRT/Marshalers.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/WindowsRuntime/Generated/WinRT/Marshalers.cs index 195b1c3c3b9..6dba91090f8 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/WindowsRuntime/Generated/WinRT/Marshalers.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/WindowsRuntime/Generated/WinRT/Marshalers.cs @@ -603,7 +603,7 @@ public static unsafe void DisposeAbiArray(object box) } } - internal class MarshalInterfaceHelper + internal static class MarshalInterfaceHelper { internal struct MarshalerArray { @@ -974,7 +974,7 @@ public static unsafe void CopyManaged(object o, IntPtr dest, bool unwrapObject = public static unsafe void DisposeAbiArray(object box) => MarshalInterfaceHelper.DisposeAbiArray(box); } - internal class Marshaler + internal static class Marshaler { static Marshaler() { diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Documents/MsSpellCheckLib/RCW.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Documents/MsSpellCheckLib/RCW.cs index 2b6473e0e33..6ee4f4ca39c 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Documents/MsSpellCheckLib/RCW.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Documents/MsSpellCheckLib/RCW.cs @@ -24,7 +24,7 @@ namespace System.Windows.Documents { namespace MsSpellCheckLib { - internal class RCW + internal static class RCW { #region WORDLIST_TYPE diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Documents/TextTreeDumper.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Documents/TextTreeDumper.cs index 57a6f1966d6..7baba8dcc51 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Documents/TextTreeDumper.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Documents/TextTreeDumper.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // @@ -16,22 +16,8 @@ namespace System.Windows.Documents // TextTreeDumper.DumpTree(texttree); // TextTreeDumper.DumpNode(someNode); // - internal class TextTreeDumper + internal static class TextTreeDumper { - //------------------------------------------------------ - // - // Constructors - // - //------------------------------------------------------ - - #region Constructors - - // Static class. - private TextTreeDumper() - { - } - - #endregion Constructors //------------------------------------------------------ // diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/WpfXamlLoader.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/WpfXamlLoader.cs index 42947d82700..f1cd1f9af95 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/WpfXamlLoader.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/WpfXamlLoader.cs @@ -12,7 +12,7 @@ namespace System.Windows.Markup { - internal class WpfXamlLoader + internal static class WpfXamlLoader { private static Lazy XmlSpace = new Lazy(() => new WpfXamlMember(XmlAttributeProperties.XmlSpaceProperty, true)); diff --git a/src/Microsoft.DotNet.Wpf/src/ReachFramework/PrintConfig/PrintSchema.cs b/src/Microsoft.DotNet.Wpf/src/ReachFramework/PrintConfig/PrintSchema.cs index 57c2e767ebd..46e30c0d7d1 100644 --- a/src/Microsoft.DotNet.Wpf/src/ReachFramework/PrintConfig/PrintSchema.cs +++ b/src/Microsoft.DotNet.Wpf/src/ReachFramework/PrintConfig/PrintSchema.cs @@ -1864,10 +1864,8 @@ internal enum PrintSchemaNodeTypes /// /// Internal class to hold standard namespaces used by Print Schema /// - internal class PrintSchemaNamespaces + internal static class PrintSchemaNamespaces { - private PrintSchemaNamespaces() {} - public const string Framework = "http://schemas.microsoft.com/windows/2003/08/printing/printschemaframework"; public const string StandardKeywordSet = "http://schemas.microsoft.com/windows/2003/08/printing/printschemakeywords"; public const string xsi = "http://www.w3.org/2001/XMLSchema-instance"; @@ -1883,10 +1881,8 @@ private PrintSchemaNamespaces() {} /// /// Internal class to hold prefixes for Print Schema standard namespaces /// - internal class PrintSchemaPrefixes + internal static class PrintSchemaPrefixes { - private PrintSchemaPrefixes() {} - public const string Framework = "psf"; public const string StandardKeywordSet = "psk"; public const string xsi = "xsi"; @@ -1897,10 +1893,8 @@ private PrintSchemaPrefixes() {} /// /// Internal class to hold const strings for standard xsi types /// - internal class PrintSchemaXsiTypes + internal static class PrintSchemaXsiTypes { - private PrintSchemaXsiTypes() {} - public const string Integer = "integer"; public const string String = "string"; public const string QName = "QName"; @@ -1909,10 +1903,8 @@ private PrintSchemaXsiTypes() {} /// /// Internal class to hold public Print Schema constant keywords /// - internal class PrintSchemaTags + internal static class PrintSchemaTags { - private PrintSchemaTags() {} - internal struct MapEntry { public string SchemaName; @@ -1924,10 +1916,8 @@ public MapEntry(string schemaName, int enumValue) } } - internal class Framework + internal static class Framework { - private Framework() {} - internal const decimal SchemaVersion = 1; internal const string PrintTicketRoot = "PrintTicket"; @@ -1969,34 +1959,26 @@ private Framework() {} ""; } - internal class Keywords + internal static class Keywords { - private Keywords() {} - - internal class CollateKeys + internal static class CollateKeys { - private CollateKeys() { } - internal const string DocumentCollate = "DocumentCollate"; internal static string[] CollationNames = Enum.GetNames(typeof(Collation)); internal static int[] CollationEnums = (int[])(Array)Enum.GetValues(); } - internal class DuplexKeys + internal static class DuplexKeys { - private DuplexKeys() { } - internal const string JobDuplex = "JobDuplexAllDocumentsContiguously"; internal static string[] DuplexNames = Enum.GetNames(typeof(Duplexing)); internal static int[] DuplexEnums = (int[])(Array)Enum.GetValues(); } - internal class NUpKeys + internal static class NUpKeys { - private NUpKeys() {} - internal const string JobNUp = "JobNUpAllDocumentsContiguously"; internal const string PagesPerSheet = "PagesPerSheet"; internal const string PresentationDirection = "PresentationDirection"; @@ -2005,30 +1987,24 @@ private NUpKeys() {} internal static int[] DirectionEnums = (int[])(Array)Enum.GetValues(); } - internal class StapleKeys + internal static class StapleKeys { - private StapleKeys() {} - internal const string JobStaple = "JobStapleAllDocuments"; internal static string[] StaplingNames = Enum.GetNames(typeof(Stapling)); internal static int[] StaplingEnums = (int[])(Array)Enum.GetValues(); } - internal class PageDeviceFontSubstitutionKeys + internal static class PageDeviceFontSubstitutionKeys { - private PageDeviceFontSubstitutionKeys() {} - internal const string Self = "PageDeviceFontSubstitution"; internal static string[] SubstitutionNames = Enum.GetNames(typeof(DeviceFontSubstitution)); internal static int[] SubstitutionEnums = (int[])(Array)Enum.GetValues(); } - internal class PageMediaSizeKeys + internal static class PageMediaSizeKeys { - private PageMediaSizeKeys() { } - internal const string Self = "PageMediaSize"; internal const string MediaSizeWidth = "MediaSizeWidth"; internal const string MediaSizeHeight = "MediaSizeHeight"; @@ -2044,10 +2020,8 @@ private PageMediaSizeKeys() { } internal static int[] MediaSizeEnums = (int[])(Array)Enum.GetValues(); } - internal class PageImageableSizeKeys + internal static class PageImageableSizeKeys { - private PageImageableSizeKeys() { } - internal const string Self = "PageImageableSize"; internal const string ImageableSizeWidth = "ImageableSizeWidth"; internal const string ImageableSizeHeight = "ImageableSizeHeight"; @@ -2060,40 +2034,32 @@ private PageImageableSizeKeys() { } internal const string ExtentHeight = "ExtentHeight"; } - internal class PageMediaTypeKeys + internal static class PageMediaTypeKeys { - private PageMediaTypeKeys() {} - internal const string Self = "PageMediaType"; internal static string[] MediaTypeNames = Enum.GetNames(typeof(PageMediaType)); internal static int[] MediaTypeEnums = (int[])(Array)Enum.GetValues(); } - internal class PageOrientationKeys + internal static class PageOrientationKeys { - private PageOrientationKeys() {} - internal const string Self = "PageOrientation"; internal static string[] OrientationNames = Enum.GetNames(typeof(PageOrientation)); internal static int[] OrientationEnums = (int[])(Array)Enum.GetValues(); } - internal class PageOutputColorKeys + internal static class PageOutputColorKeys { - private PageOutputColorKeys() {} - internal const string Self = "PageOutputColor"; internal static string[] ColorNames = Enum.GetNames(typeof(OutputColor)); internal static int[] ColorEnums = (int[])(Array)Enum.GetValues(); } - internal class PageResolutionKeys + internal static class PageResolutionKeys { - private PageResolutionKeys() {} - internal const string Self = "PageResolution"; internal const string ResolutionX = "ResolutionX"; internal const string ResolutionY = "ResolutionY"; @@ -2103,10 +2069,8 @@ private PageResolutionKeys() {} internal static int[] QualityEnums = (int[])(Array)Enum.GetValues(); } - internal class PageScalingKeys + internal static class PageScalingKeys { - private PageScalingKeys() { } - internal const string Self = "PageScaling"; internal const string CustomScaleWidth = "ScaleWidth"; internal const string CustomScaleHeight = "ScaleHeight"; @@ -2116,60 +2080,48 @@ private PageScalingKeys() { } internal static int[] ScalingEnums = (int[])(Array)Enum.GetValues(); } - internal class PageTrueTypeFontModeKeys + internal static class PageTrueTypeFontModeKeys { - private PageTrueTypeFontModeKeys() { } - internal const string Self = "PageTrueTypeFontMode"; internal static string[] ModeNames = Enum.GetNames(typeof(TrueTypeFontMode)); internal static int[] ModeEnums = (int[])(Array)Enum.GetValues(); } - internal class JobPageOrderKeys + internal static class JobPageOrderKeys { - private JobPageOrderKeys() { } - internal const string Self = "JobPageOrder"; internal static string[] PageOrderNames = Enum.GetNames(typeof(PageOrder)); internal static int[] PageOrderEnums = (int[])(Array)Enum.GetValues(); } - internal class PagePhotoPrintingIntentKeys + internal static class PagePhotoPrintingIntentKeys { - private PagePhotoPrintingIntentKeys() { } - internal const string Self = "PagePhotoPrintingIntent"; internal static string[] PhotoIntentNames = Enum.GetNames(typeof(PhotoPrintingIntent)); internal static int[] PhotoIntentEnums = (int[])(Array)Enum.GetValues(); } - internal class PageBorderlessKeys + internal static class PageBorderlessKeys { - private PageBorderlessKeys() { } - internal const string Self = "PageBorderless"; internal static string[] BorderlessNames = Enum.GetNames(typeof(PageBorderless)); internal static int[] BorderlessEnums = (int[])(Array)Enum.GetValues(); } - internal class PageOutputQualityKeys + internal static class PageOutputQualityKeys { - private PageOutputQualityKeys() { } - internal const string Self = "PageOutputQuality"; internal static string[] OutputQualityNames = Enum.GetNames(typeof(OutputQuality)); internal static int[] OutputQualityEnums = (int[])(Array)Enum.GetValues(); } - internal class InputBinKeys + internal static class InputBinKeys { - private InputBinKeys() { } - internal const string JobInputBin = "JobInputBin"; internal const string DocumentInputBin = "DocumentInputBin"; internal const string PageInputBin = "PageInputBin"; @@ -2178,19 +2130,15 @@ private InputBinKeys() { } internal static int[] InputBinEnums = (int[])(Array)Enum.GetValues(); } - internal class ParameterProps + internal static class ParameterProps { - private ParameterProps() {} - internal const string DefaultValue = "DefaultValue"; internal const string MinValue = "MinValue"; internal const string MaxValue = "MaxValue"; } - internal class ParameterDefs + internal static class ParameterDefs { - private ParameterDefs() {} - internal const string JobCopyCount = "JobCopiesAllDocuments"; // for non-PS custom media size. @@ -2245,9 +2193,8 @@ private ParameterDefs() {} } } - internal class UnitConverter + internal static class UnitConverter { - private UnitConverter() {} /// /// Converts internal micron length value to DIP length value (in 1/96 inch unit). diff --git a/src/Microsoft.DotNet.Wpf/src/ReachFramework/PrintConfig/PrtCap_Reader.cs b/src/Microsoft.DotNet.Wpf/src/ReachFramework/PrintConfig/PrtCap_Reader.cs index b004e2cc918..0c74b5997a4 100644 --- a/src/Microsoft.DotNet.Wpf/src/ReachFramework/PrintConfig/PrtCap_Reader.cs +++ b/src/Microsoft.DotNet.Wpf/src/ReachFramework/PrintConfig/PrtCap_Reader.cs @@ -511,14 +511,9 @@ private static FormatException NewPrintCapFormatException(string detailMsg, Exce /// /// QName helper class for XMLTextReader /// - internal class XmlReaderQName + internal static class XmlReaderQName { - #region Constructors - - // Never need to use an instance. All static methods. - private XmlReaderQName() {} - #endregion Constructors #region Public Methods diff --git a/src/Microsoft.DotNet.Wpf/src/ReachFramework/PrintConfig/PrtTicket_Editor.cs b/src/Microsoft.DotNet.Wpf/src/ReachFramework/PrintConfig/PrtTicket_Editor.cs index 00f577a33f3..47ef6667bd8 100644 --- a/src/Microsoft.DotNet.Wpf/src/ReachFramework/PrintConfig/PrtTicket_Editor.cs +++ b/src/Microsoft.DotNet.Wpf/src/ReachFramework/PrintConfig/PrtTicket_Editor.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /*++ @@ -17,11 +17,10 @@ Definition and implementation of the internal PrintTicketEditor and XmlDocQName namespace MS.Internal.Printing.Configuration { - internal class PrintTicketEditor + internal static class PrintTicketEditor { - #region Constructors - private PrintTicketEditor() {} + #region Constructors #endregion Constructors @@ -405,11 +404,10 @@ private static FormatException NewPTFormatException(string detailMsg, Exception #endregion Private Methods } - internal class XmlDocQName + internal static class XmlDocQName { - #region Constructors - private XmlDocQName() {} + #region Constructors #endregion Constructors diff --git a/src/Microsoft.DotNet.Wpf/src/ReachFramework/Serialization/manager/XpsLiterals.cs b/src/Microsoft.DotNet.Wpf/src/ReachFramework/Serialization/manager/XpsLiterals.cs index 3012a0d718c..9e1a9d79248 100644 --- a/src/Microsoft.DotNet.Wpf/src/ReachFramework/Serialization/manager/XpsLiterals.cs +++ b/src/Microsoft.DotNet.Wpf/src/ReachFramework/Serialization/manager/XpsLiterals.cs @@ -16,14 +16,8 @@ named properties or attributes of the Xps Serialization namespace System.Windows.Xps.Packaging { - internal class XpsNamedProperties + internal static class XpsNamedProperties { - private - XpsNamedProperties( - ) - { - } - public static String @@ -56,7 +50,7 @@ internal class XpsNamedProperties String _clrProperty = "Property"; }; - internal class XpsS0Markup + internal static class XpsS0Markup { public static @@ -1233,14 +1227,8 @@ String this[int index] string _versionExtensiblityNamespace ="http://schemas.openxmlformats.org/markup-compatibility/2006"; }; - internal class XmlTags + internal static class XmlTags { - private - XmlTags( - ) - { - } - public static String diff --git a/src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/TextServicesLoader.cs b/src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/TextServicesLoader.cs index c02ff33eae6..79299b53251 100644 --- a/src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/TextServicesLoader.cs +++ b/src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/TextServicesLoader.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // @@ -30,21 +30,9 @@ namespace MS.Internal { // Creates ITfThreadMgr instances, the root object of the Text Services // Framework. - internal class TextServicesLoader + internal static class TextServicesLoader { - //------------------------------------------------------ - // - // Constructors - // - //------------------------------------------------------ - #region Constructors - - // Private ctor to prevent anyone from instantiating this static class. - private TextServicesLoader() {} - - #endregion Constructors - //------------------------------------------------------ // // Public Methods @@ -68,7 +56,7 @@ private TextServicesLoader() {} // Protected Methods // //------------------------------------------------------ - + //------------------------------------------------------ // // Internal Methods @@ -82,7 +70,7 @@ private TextServicesLoader() {} //------------------------------------------------------ #region Internal Properties - + /// /// Loads an instance of the Text Services Framework. /// diff --git a/src/Microsoft.DotNet.Wpf/src/Shared/MS/Win32/NativeMethodsOther.cs b/src/Microsoft.DotNet.Wpf/src/Shared/MS/Win32/NativeMethodsOther.cs index ce166c5a724..cedbbd5254a 100644 --- a/src/Microsoft.DotNet.Wpf/src/Shared/MS/Win32/NativeMethodsOther.cs +++ b/src/Microsoft.DotNet.Wpf/src/Shared/MS/Win32/NativeMethodsOther.cs @@ -8,7 +8,7 @@ namespace MS.Win32 { - internal partial class NativeMethods + internal static partial class NativeMethods { // Translates Win32 error codes into HRESULTs. public static int MakeHRFromErrorCode(int errorCode) diff --git a/src/Microsoft.DotNet.Wpf/src/Shared/MS/Win32/UnsafeNativeMethodsCLR.cs b/src/Microsoft.DotNet.Wpf/src/Shared/MS/Win32/UnsafeNativeMethodsCLR.cs index b334ff8bd3c..932d879b674 100644 --- a/src/Microsoft.DotNet.Wpf/src/Shared/MS/Win32/UnsafeNativeMethodsCLR.cs +++ b/src/Microsoft.DotNet.Wpf/src/Shared/MS/Win32/UnsafeNativeMethodsCLR.cs @@ -39,7 +39,7 @@ namespace MS.Win32 { - internal partial class UnsafeNativeMethods + internal static partial class UnsafeNativeMethods { [DllImport(ExternDll.Uxtheme, CharSet = CharSet.Auto, BestFitMapping = false)] diff --git a/src/Microsoft.DotNet.Wpf/src/Shared/Telemetry/Managed/EventSourceActivity.cs b/src/Microsoft.DotNet.Wpf/src/Shared/Telemetry/Managed/EventSourceActivity.cs index 2184be08a3e..dea246d5ab8 100644 --- a/src/Microsoft.DotNet.Wpf/src/Shared/Telemetry/Managed/EventSourceActivity.cs +++ b/src/Microsoft.DotNet.Wpf/src/Shared/Telemetry/Managed/EventSourceActivity.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics.Tracing; @@ -351,26 +351,21 @@ private enum State } [EventData] - private class EmptyStruct + private sealed class EmptyStruct { - private EmptyStruct() - { - - } + private EmptyStruct() { } internal static EmptyStruct Instance { get { - if (_instance == null) - { - _instance = new EmptyStruct(); - } - return _instance; + s_instance ??= new EmptyStruct(); + + return s_instance; } } - private static EmptyStruct _instance; + private static EmptyStruct s_instance; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Win32/externdll.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Win32/externdll.cs index 1f23f1475b4..8cc8148245a 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Win32/externdll.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Win32/externdll.cs @@ -1,14 +1,10 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace MS.Win32 { - internal class ExternDll + internal static class ExternDll { - // To appease the FxCop - private ExternDll() - { } - internal const string Gdiplus = "gdiplus.dll"; internal const string User32 = "user32.dll"; internal const string Shfolder = "shfolder.dll"; diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/IO/Packaging/PackagingExtensions.cs b/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/IO/Packaging/PackagingExtensions.cs index c217e1e89b5..90c080ab9e4 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/IO/Packaging/PackagingExtensions.cs +++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/IO/Packaging/PackagingExtensions.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.IO.Packaging; @@ -16,7 +16,7 @@ public static ContentType ValidatedContentType(this PackagePart packagePart) } } - internal class PackageRelationship + internal static class PackageRelationship { public static Uri ContainerRelationshipPartName => System.IO.Packaging.PackUriHelper.CreatePartUri(new Uri("/_rels/.rels", UriKind.Relative)); }