From 932604d0bebd3723bb3b51ef870e74a059d6130b Mon Sep 17 00:00:00 2001
From: TillW <14997061+x789@users.noreply.github.com>
Date: Tue, 13 Dec 2022 11:45:04 +0100
Subject: [PATCH 1/2] Remove CA2109 (#5974)
---
.../CSharpReviewVisibleEventHandlers.Fixer.cs | 17 --
.../Core/AnalyzerReleases.Unshipped.md | 6 +
.../ReviewVisibleEventHandlers.Fixer.cs | 29 ---
.../ReviewVisibleEventHandlers.cs | 66 -----
.../Microsoft.CodeAnalysis.NetAnalyzers.md | 12 -
.../Microsoft.CodeAnalysis.NetAnalyzers.sarif | 21 --
.../ReviewVisibleEventHandlersTests.cs | 246 ------------------
.../BasicReviewVisibleEventHandlers.Fixer.vb | 17 --
8 files changed, 6 insertions(+), 408 deletions(-)
delete mode 100644 src/NetAnalyzers/CSharp/Microsoft.CodeQuality.Analyzers/QualityGuidelines/CSharpReviewVisibleEventHandlers.Fixer.cs
delete mode 100644 src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/QualityGuidelines/ReviewVisibleEventHandlers.Fixer.cs
delete mode 100644 src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/QualityGuidelines/ReviewVisibleEventHandlers.cs
delete mode 100644 src/NetAnalyzers/UnitTests/Microsoft.CodeQuality.Analyzers/QualityGuidelines/ReviewVisibleEventHandlersTests.cs
delete mode 100644 src/NetAnalyzers/VisualBasic/Microsoft.CodeQuality.Analyzers/QualityGuidelines/BasicReviewVisibleEventHandlers.Fixer.vb
diff --git a/src/NetAnalyzers/CSharp/Microsoft.CodeQuality.Analyzers/QualityGuidelines/CSharpReviewVisibleEventHandlers.Fixer.cs b/src/NetAnalyzers/CSharp/Microsoft.CodeQuality.Analyzers/QualityGuidelines/CSharpReviewVisibleEventHandlers.Fixer.cs
deleted file mode 100644
index 8fdf29e8e0..0000000000
--- a/src/NetAnalyzers/CSharp/Microsoft.CodeQuality.Analyzers/QualityGuidelines/CSharpReviewVisibleEventHandlers.Fixer.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.
-
-using System.Composition;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CodeFixes;
-using Microsoft.CodeQuality.Analyzers.QualityGuidelines;
-
-namespace Microsoft.CodeQuality.CSharp.Analyzers.QualityGuidelines
-{
- ///
- /// CA2109: Review visible event handlers
- ///
- [ExportCodeFixProvider(LanguageNames.CSharp), Shared]
- public sealed class CSharpReviewVisibleEventHandlersFixer : ReviewVisibleEventHandlersFixer
- {
- }
-}
\ No newline at end of file
diff --git a/src/NetAnalyzers/Core/AnalyzerReleases.Unshipped.md b/src/NetAnalyzers/Core/AnalyzerReleases.Unshipped.md
index 27e48718d7..cc57137b64 100644
--- a/src/NetAnalyzers/Core/AnalyzerReleases.Unshipped.md
+++ b/src/NetAnalyzers/Core/AnalyzerReleases.Unshipped.md
@@ -10,3 +10,9 @@ CA1512 | Maintainability | Info | UseExceptionThrowHelpers, [Documentation](http
CA1513 | Maintainability | Info | UseExceptionThrowHelpers, [Documentation](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1513)
CA1856 | Performance | Error | ConstantExpectedAnalyzer, [Documentation](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1856)
CA1857 | Performance | Warning | ConstantExpectedAnalyzer, [Documentation](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1857)
+
+### Removed Rules
+
+Rule ID | Category | Severity | Notes
+--------|----------|----------|-------
+CA2109 | Security | Disabled | ReviewVisibleEventHandlersAnalyzer, [Documentation](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2109)
diff --git a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/QualityGuidelines/ReviewVisibleEventHandlers.Fixer.cs b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/QualityGuidelines/ReviewVisibleEventHandlers.Fixer.cs
deleted file mode 100644
index 62681cfdca..0000000000
--- a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/QualityGuidelines/ReviewVisibleEventHandlers.Fixer.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.
-
-using System.Collections.Immutable;
-using System.Threading.Tasks;
-using Microsoft.CodeAnalysis.CodeFixes;
-
-namespace Microsoft.CodeQuality.Analyzers.QualityGuidelines
-{
- ///
- /// CA2109: Review visible event handlers
- ///
- public abstract class ReviewVisibleEventHandlersFixer : CodeFixProvider
- {
- public sealed override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Empty;
-
- public sealed override FixAllProvider GetFixAllProvider()
- {
- // See https://github.com/dotnet/roslyn/blob/main/docs/analyzers/FixAllProvider.md for more information on Fix All Providers
- return WellKnownFixAllProviders.BatchFixer;
- }
-
- public sealed override Task RegisterCodeFixesAsync(CodeFixContext context)
- {
- // Fixer not yet implemented.
- return Task.CompletedTask;
-
- }
- }
-}
\ No newline at end of file
diff --git a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/QualityGuidelines/ReviewVisibleEventHandlers.cs b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/QualityGuidelines/ReviewVisibleEventHandlers.cs
deleted file mode 100644
index b234fcbdde..0000000000
--- a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/QualityGuidelines/ReviewVisibleEventHandlers.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.
-
-using System.Collections.Immutable;
-using Analyzer.Utilities;
-using Analyzer.Utilities.Extensions;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.Diagnostics;
-
-namespace Microsoft.CodeQuality.Analyzers.QualityGuidelines
-{
- using static MicrosoftCodeQualityAnalyzersResources;
-
- ///
- /// CA2109:
- ///
- [DiagnosticAnalyzer(LanguageNames.CSharp, LanguageNames.VisualBasic)]
- public sealed class ReviewVisibleEventHandlersAnalyzer : DiagnosticAnalyzer
- {
- internal const string RuleId = "CA2109";
-
- internal static readonly DiagnosticDescriptor Rule = DiagnosticDescriptorHelper.Create(
- RuleId,
- CreateLocalizableResourceString(nameof(ReviewVisibleEventHandlersTitle)),
- CreateLocalizableResourceString(nameof(ReviewVisibleEventHandlersMessageDefault)),
- DiagnosticCategory.Security,
- RuleLevel.Disabled,
- description: CreateLocalizableResourceString(nameof(ReviewVisibleEventHandlersDescription)),
- isPortedFxCopRule: true,
- isDataflowRule: false);
-
- public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);
-
- public override void Initialize(AnalysisContext context)
- {
- context.EnableConcurrentExecution();
- context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None);
-
- context.RegisterCompilationStartAction(context =>
- {
- var eventArgsType = context.Compilation.GetOrCreateTypeByMetadataName(WellKnownTypeNames.SystemEventArgs);
-
- context.RegisterSymbolAction(context =>
- {
- var method = (IMethodSymbol)context.Symbol;
-
- if (!method.IsExternallyVisible())
- {
- return;
- }
-
- if (!method.HasEventHandlerSignature(eventArgsType))
- {
- return;
- }
-
- if (method.IsOverride || method.IsImplementationOfAnyInterfaceMember())
- {
- return;
- }
-
- context.ReportDiagnostic(method.CreateDiagnostic(Rule, method.Name));
- }, SymbolKind.Method);
- });
- }
- }
-}
\ No newline at end of file
diff --git a/src/NetAnalyzers/Microsoft.CodeAnalysis.NetAnalyzers.md b/src/NetAnalyzers/Microsoft.CodeAnalysis.NetAnalyzers.md
index 098d2f15a1..f39d1a13e9 100644
--- a/src/NetAnalyzers/Microsoft.CodeAnalysis.NetAnalyzers.md
+++ b/src/NetAnalyzers/Microsoft.CodeAnalysis.NetAnalyzers.md
@@ -1860,18 +1860,6 @@ A platform invoke member allows partially trusted callers, has a string paramete
|CodeFix|True|
---
-## [CA2109](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2109): Review visible event handlers
-
-A public or protected event-handling method was detected. Event-handling methods should not be exposed unless absolutely necessary.
-
-|Item|Value|
-|-|-|
-|Category|Security|
-|Enabled|False|
-|Severity|Warning|
-|CodeFix|False|
----
-
## [CA2119](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2119): Seal methods that satisfy private interfaces
An inheritable public type provides an overridable method implementation of an internal (Friend in Visual Basic) interface. To fix a violation of this rule, prevent the method from being overridden outside the assembly.
diff --git a/src/NetAnalyzers/Microsoft.CodeAnalysis.NetAnalyzers.sarif b/src/NetAnalyzers/Microsoft.CodeAnalysis.NetAnalyzers.sarif
index 2e18b39eec..0a572bfd80 100644
--- a/src/NetAnalyzers/Microsoft.CodeAnalysis.NetAnalyzers.sarif
+++ b/src/NetAnalyzers/Microsoft.CodeAnalysis.NetAnalyzers.sarif
@@ -3361,27 +3361,6 @@
]
}
},
- "CA2109": {
- "id": "CA2109",
- "shortDescription": "Review visible event handlers",
- "fullDescription": "A public or protected event-handling method was detected. Event-handling methods should not be exposed unless absolutely necessary.",
- "defaultLevel": "warning",
- "helpUri": "https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2109",
- "properties": {
- "category": "Security",
- "isEnabledByDefault": false,
- "typeName": "ReviewVisibleEventHandlersAnalyzer",
- "languages": [
- "C#",
- "Visual Basic"
- ],
- "tags": [
- "PortedFromFxCop",
- "Telemetry",
- "EnabledRuleInAggressiveMode"
- ]
- }
- },
"CA2119": {
"id": "CA2119",
"shortDescription": "Seal methods that satisfy private interfaces",
diff --git a/src/NetAnalyzers/UnitTests/Microsoft.CodeQuality.Analyzers/QualityGuidelines/ReviewVisibleEventHandlersTests.cs b/src/NetAnalyzers/UnitTests/Microsoft.CodeQuality.Analyzers/QualityGuidelines/ReviewVisibleEventHandlersTests.cs
deleted file mode 100644
index a0a8a7bc8d..0000000000
--- a/src/NetAnalyzers/UnitTests/Microsoft.CodeQuality.Analyzers/QualityGuidelines/ReviewVisibleEventHandlersTests.cs
+++ /dev/null
@@ -1,246 +0,0 @@
-// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.
-
-using System.Threading.Tasks;
-using Xunit;
-using VerifyCS = Test.Utilities.CSharpCodeFixVerifier<
- Microsoft.CodeQuality.Analyzers.QualityGuidelines.ReviewVisibleEventHandlersAnalyzer,
- Microsoft.CodeAnalysis.Testing.EmptyCodeFixProvider>;
-using VerifyVB = Test.Utilities.VisualBasicCodeFixVerifier<
- Microsoft.CodeQuality.Analyzers.QualityGuidelines.ReviewVisibleEventHandlersAnalyzer,
- Microsoft.CodeAnalysis.Testing.EmptyCodeFixProvider>;
-
-namespace Microsoft.CodeQuality.Analyzers.QualityGuidelines.UnitTests
-{
- public class ReviewVisibleEventHandlersTests
- {
- [Fact]
- public async Task CA2109_PublicEventHandler_DiagnosticAsync()
- {
- await VerifyCS.VerifyAnalyzerAsync(@"
-using System;
-
-public class Program
-{
- public void Handler1(object sender, EventArgs args) {}
- protected void Handler2(object sender, EventArgs args) {}
-}",
-#pragma warning disable RS0030 // Do not use banned APIs
- VerifyCS.Diagnostic().WithLocation(6, 17).WithArguments("Handler1"),
-#pragma warning restore RS0030 // Do not use banned APIs
-#pragma warning disable RS0030 // Do not use banned APIs
- VerifyCS.Diagnostic().WithLocation(7, 20).WithArguments("Handler2"));
-#pragma warning restore RS0030 // Do not use banned APIs
-
- await VerifyVB.VerifyAnalyzerAsync(@"
-Imports System
-
-Public Class Program
- Public Sub Handler1(ByVal sender As Object, ByVal args As EventArgs)
- End Sub
-
- Protected Sub Handler2(ByVal sender As Object, ByVal args As EventArgs)
- End Sub
-End Class",
-#pragma warning disable RS0030 // Do not use banned APIs
- VerifyVB.Diagnostic().WithLocation(5, 16).WithArguments("Handler1"),
-#pragma warning restore RS0030 // Do not use banned APIs
-#pragma warning disable RS0030 // Do not use banned APIs
- VerifyVB.Diagnostic().WithLocation(8, 19).WithArguments("Handler2"));
-#pragma warning restore RS0030 // Do not use banned APIs
- }
-
- [Fact]
- public async Task CA2109_PublicEventHandlerWithSecurityAttribute_DiagnosticAsync()
- {
- await VerifyCS.VerifyAnalyzerAsync(@"
-using System;
-using System.Security.Permissions;
-
-public class Program
-{
- [SecurityPermissionAttribute(SecurityAction.Demand, UnmanagedCode=true)]
- public void [|Handler1|](object sender, EventArgs args) {}
-}");
-
- await VerifyVB.VerifyAnalyzerAsync(@"
-Imports System
-Imports System.Security.Permissions
-
-Public Class Program
-
- Public Sub [|Handler1|](ByVal sender As Object, ByVal args As EventArgs)
- End Sub
-End Class");
- }
-
- [Fact]
- public async Task CA2109_PublicEventHandlerUWP_DiagnosticAsync()
- {
- await VerifyCS.VerifyAnalyzerAsync(@"
-namespace Windows.UI.Xaml
-{
- public class RoutedEventArgs {}
-}
-
-public class Program
-{
- public void [|Handler1|](object sender, Windows.UI.Xaml.RoutedEventArgs args) {}
-}");
-
- await VerifyVB.VerifyAnalyzerAsync(@"
-Namespace Windows.UI.Xaml
- Public Class RoutedEventArgs
- End Class
-End Namespace
-
-Public Class Program
- Public Sub [|Handler1|](ByVal sender As Object, ByVal args As Windows.UI.Xaml.RoutedEventArgs)
- End Sub
-End Class");
- }
-
- [Fact]
- public async Task CA2109_PrivateInternalEventHandler_NoDiagnosticAsync()
- {
- await VerifyCS.VerifyAnalyzerAsync(@"
-using System;
-
-public class Program
-{
- private void Handler1(object sender, EventArgs args) {}
- internal void Handler2(object sender, EventArgs args) {}
-}");
-
- await VerifyVB.VerifyAnalyzerAsync(@"
-Imports System
-
-Public Class Program
- Private Sub Handler1(ByVal sender As Object, ByVal args As EventArgs)
- End Sub
-
- Friend Sub Handler2(ByVal sender As Object, ByVal args As EventArgs)
- End Sub
-End Class");
- }
-
- [Fact]
- public async Task CA2109_PublicProtectedNotEventHandler_NoDiagnosticAsync()
- {
- await VerifyCS.VerifyAnalyzerAsync(@"
-using System;
-
-public class Program
-{
- public void Handler1(object sender) {}
- public void Handler2(object sender, object o) {}
-}");
-
- await VerifyVB.VerifyAnalyzerAsync(@"
-Imports System
-
-Public Class Program
- Public Sub Handler1(ByVal sender As Object)
- End Sub
-
- Public Sub Handler2(ByVal sender As Object, ByVal o As Object)
- End Sub
-End Class");
- }
-
- [Fact]
- public async Task CA2109_PublicOverrideVirtualEventHandler_NoDiagnosticAsync()
- {
- await VerifyCS.VerifyAnalyzerAsync(@"
-using System;
-
-public class A
-{
- public virtual void [|Handler1|](object sender, EventArgs args) {}
-}
-
-public class B : A
-{
- public override void Handler1(object sender, EventArgs args) {}
-}");
-
- await VerifyVB.VerifyAnalyzerAsync(@"
-Imports System
-
-Public Class A
- Public Overridable Sub [|Handler1|](ByVal sender As Object, ByVal args As EventArgs)
- End Sub
-End Class
-
-Public Class B
- Inherits A
-
- Public Overrides Sub Handler1(ByVal sender As Object, ByVal args As EventArgs)
- End Sub
-End Class
-");
- }
-
- [Fact]
- public async Task CA2109_PublicOverrideAbstractEventHandler_NoDiagnosticAsync()
- {
- await VerifyCS.VerifyAnalyzerAsync(@"
-using System;
-
-public abstract class A
-{
- public abstract void [|Handler1|](object sender, EventArgs args);
-}
-
-public class B : A
-{
- public override void Handler1(object sender, EventArgs args) {}
-}");
-
- await VerifyVB.VerifyAnalyzerAsync(@"
-Imports System
-
-Public MustInherit Class A
- Public MustOverride Sub [|Handler1|](ByVal sender As Object, ByVal args As EventArgs)
-End Class
-
-Public Class B
- Inherits A
-
- Public Overrides Sub Handler1(ByVal sender As Object, ByVal args As EventArgs)
- End Sub
-End Class
-");
- }
-
- [Fact]
- public async Task CA2109_PublicInterfaceImplementationEventHandler_NoDiagnosticAsync()
- {
- await VerifyCS.VerifyAnalyzerAsync(@"
-using System;
-
-public interface IA
-{
- void [|Handler1|](object sender, EventArgs args);
-}
-
-public class B : IA
-{
- public void Handler1(object sender, EventArgs args) {}
-}");
-
- await VerifyVB.VerifyAnalyzerAsync(@"
-Imports System
-
-Public Interface IA
- Sub [|Handler1|](ByVal sender As Object, ByVal args As EventArgs)
-End Interface
-
-Public Class B
- Implements IA
-
- Public Sub Handler1(ByVal sender As Object, ByVal args As EventArgs) Implements IA.Handler1
- End Sub
-End Class");
- }
- }
-}
\ No newline at end of file
diff --git a/src/NetAnalyzers/VisualBasic/Microsoft.CodeQuality.Analyzers/QualityGuidelines/BasicReviewVisibleEventHandlers.Fixer.vb b/src/NetAnalyzers/VisualBasic/Microsoft.CodeQuality.Analyzers/QualityGuidelines/BasicReviewVisibleEventHandlers.Fixer.vb
deleted file mode 100644
index c309634f13..0000000000
--- a/src/NetAnalyzers/VisualBasic/Microsoft.CodeQuality.Analyzers/QualityGuidelines/BasicReviewVisibleEventHandlers.Fixer.vb
+++ /dev/null
@@ -1,17 +0,0 @@
-' Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.
-
-Imports System.Composition
-Imports Microsoft.CodeAnalysis
-Imports Microsoft.CodeAnalysis.CodeFixes
-Imports Microsoft.CodeQuality.Analyzers.QualityGuidelines
-
-Namespace Microsoft.CodeQuality.VisualBasic.Analyzers.QualityGuidelines
- '''
- ''' CA2109: Review visible event handlers
- '''
-
- Public NotInheritable Class BasicReviewVisibleEventHandlersFixer
- Inherits ReviewVisibleEventHandlersFixer
-
- End Class
-End Namespace
From 63c4dcf8f86ea2cfcdc8994a20634ef400db2f3f Mon Sep 17 00:00:00 2001
From: TillW <14997061+x789@users.noreply.github.com>
Date: Tue, 13 Dec 2022 14:32:22 +0100
Subject: [PATCH 2/2] Remove resources of rule CA2109
---
.../MicrosoftCodeQualityAnalyzersResources.resx | 9 ---------
.../MicrosoftCodeQualityAnalyzersResources.cs.xlf | 15 ---------------
.../MicrosoftCodeQualityAnalyzersResources.de.xlf | 15 ---------------
.../MicrosoftCodeQualityAnalyzersResources.es.xlf | 15 ---------------
.../MicrosoftCodeQualityAnalyzersResources.fr.xlf | 15 ---------------
.../MicrosoftCodeQualityAnalyzersResources.it.xlf | 15 ---------------
.../MicrosoftCodeQualityAnalyzersResources.ja.xlf | 15 ---------------
.../MicrosoftCodeQualityAnalyzersResources.ko.xlf | 15 ---------------
.../MicrosoftCodeQualityAnalyzersResources.pl.xlf | 15 ---------------
...crosoftCodeQualityAnalyzersResources.pt-BR.xlf | 15 ---------------
.../MicrosoftCodeQualityAnalyzersResources.ru.xlf | 15 ---------------
.../MicrosoftCodeQualityAnalyzersResources.tr.xlf | 15 ---------------
...osoftCodeQualityAnalyzersResources.zh-Hans.xlf | 15 ---------------
...osoftCodeQualityAnalyzersResources.zh-Hant.xlf | 15 ---------------
14 files changed, 204 deletions(-)
diff --git a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/MicrosoftCodeQualityAnalyzersResources.resx b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/MicrosoftCodeQualityAnalyzersResources.resx
index cd6f8397be..0f2e968289 100644
--- a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/MicrosoftCodeQualityAnalyzersResources.resx
+++ b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/MicrosoftCodeQualityAnalyzersResources.resx
@@ -1095,15 +1095,6 @@
Member '{0}' does not access instance data and can be marked as static
-
- Review visible event handlers
-
-
- A public or protected event-handling method was detected. Event-handling methods should not be exposed unless absolutely necessary.
-
-
- Consider making '{0}' not externally visible
-
Seal methods that satisfy private interfaces
diff --git a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.cs.xlf b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.cs.xlf
index 86fdb12950..a10c37060a 100644
--- a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.cs.xlf
+++ b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.cs.xlf
@@ -1877,21 +1877,6 @@
Člen {0} nemá přístup k datům instance a je možné ho označit jako statický.
-
-
- Kontrola viditelných obslužných rutin událostí
-
-
-
-
- Zjistila se veřejná nebo chráněná metoda zpracování událostí. Metody zpracování událostí by neměly být vystaveny, pokud to není nezbytně nutné.
-
-
-
-
- Nastavte metodu {0} tak, aby nebyla externě viditelná.
-
- Zapečetění metod, které vyhovují privátním rozhraním
diff --git a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.de.xlf b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.de.xlf
index f198632829..accb15c0c0 100644
--- a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.de.xlf
+++ b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.de.xlf
@@ -1877,21 +1877,6 @@
Der Member "{0}" greift nicht auf Instanzdaten zu und kann als "static" markiert werden.
-
-
- Sichtbare Ereignishandler überprüfen
-
-
-
-
- Es wurde eine öffentliche oder geschützte Methode zum Ereignishandling ermittelt. Methoden zum Ereignishandling dürfen nur verfügbar gemacht werden, wenn es absolut erforderlich ist.
-
-
-
-
- Ziehen Sie in Betracht, "{0}" nicht extern sichtbar zu machen.
-
- Methoden versiegeln, die die Bedingungen privater Schnittstellen erfüllen
diff --git a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.es.xlf b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.es.xlf
index 10e247bf34..1a2c554d08 100644
--- a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.es.xlf
+++ b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.es.xlf
@@ -1877,21 +1877,6 @@
El miembro "{0}" no tiene acceso a los datos de la instancia y se puede marcar como static.
-
-
- Revisar los controladores de eventos visibles
-
-
-
-
- Se detectó un método de control de eventos público o protegido. No se deberían exponer los métodos de control de eventos a menos que sea absolutamente necesario.
-
-
-
-
- Podría hacer que "{0}" no fuera externamente visible.
-
- Sellar los métodos que cumplan las interfaces privadas
diff --git a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.fr.xlf b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.fr.xlf
index 50b0453f37..3825cb5bb5 100644
--- a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.fr.xlf
+++ b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.fr.xlf
@@ -1877,21 +1877,6 @@
Le membre '{0}' n'accède pas aux données d'instance et peut être marqué comme étant static
-
-
- Passer en revue les gestionnaires d'événements visibles
-
-
-
-
- Une méthode publique ou protégée de gestion des événements a été détectée. Les méthodes de gestion des événements ne doivent pas être exposées sauf en cas d'absolue nécessité.
-
-
-
-
- Rendre '{0}' non visible de manière externe
-
- Sceller les méthodes qui satisfont les interfaces privées
diff --git a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.it.xlf b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.it.xlf
index ec4334f30f..437409e8cd 100644
--- a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.it.xlf
+++ b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.it.xlf
@@ -1877,21 +1877,6 @@
Il membro {0} non accede ai dati di istanza e può essere contrassegnato come static
-
-
- Esaminare i gestori eventi visibili
-
-
-
-
- È stato rilevato un metodo di gestione eventi public o protected. I metodi di gestione eventi devono essere esposti solo se assolutamente necessario.
-
-
-
-
- Provare a rendere '{0}' non visibile esternamente
-
- Impostare come sealed i metodi che soddisfano interfacce private
diff --git a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.ja.xlf b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.ja.xlf
index de8b6c14b7..d1af7bdec8 100644
--- a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.ja.xlf
+++ b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.ja.xlf
@@ -1877,21 +1877,6 @@
メンバー '{0}' はインスタンス データにアクセスしないため、static にマークできます
-
-
- 表示するイベント ハンドラーを確認します
-
-
-
-
- パブリックまたは保護されたイベント処理メソッドが検出されました。イベント処理メソッドは、どうしても必要な場合を除いて公開しないでください。
-
-
-
-
- '{0}' の外部からの参照を不可能に設定することを検討してください
-
- プライベート インターフェイスを満たすメソッドをシールします
diff --git a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.ko.xlf b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.ko.xlf
index 5cb3a7ac87..a991cc78d8 100644
--- a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.ko.xlf
+++ b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.ko.xlf
@@ -1877,21 +1877,6 @@
'{0}' 멤버는 인스턴스 데이터에 액세스하지 않으며 static으로 표시할 수 있습니다.
-
-
- 표시되는 이벤트 처리기를 검토하세요.
-
-
-
-
- public 또는 protected 이벤트 처리 메서드가 검색되었습니다. 이벤트 처리 메서드는 필요한 경우에만 표시해야 합니다.
-
-
-
-
- '{0}'이(가) 외부에 표시되지 않도록 하세요.
-
- private 인터페이스를 만족하는 메서드를 봉인하세요.
diff --git a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.pl.xlf b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.pl.xlf
index 49a2fc025e..633582e3ed 100644
--- a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.pl.xlf
+++ b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.pl.xlf
@@ -1877,21 +1877,6 @@
Składowa „{0}” nie uzyskuje dostępu do danych wystąpienia i może zostać oznaczona jako statyczna
-
-
- Przejrzyj widoczne procedury obsługi zdarzeń
-
-
-
-
- Wykryto publiczną lub chronioną metodą obsługi zdarzeń. Nie należy ujawniać metod obsługi zdarzeń, o ile nie jest to absolutnie konieczne.
-
-
-
-
- Rozważ przekształcenie elementu „{0}” w zewnętrznie niewidoczny
-
- Pieczętuj metody, które spełniają wymagania interfejsów prywatnych
diff --git a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.pt-BR.xlf b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.pt-BR.xlf
index d8112f54a6..462ded9d46 100644
--- a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.pt-BR.xlf
+++ b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.pt-BR.xlf
@@ -1877,21 +1877,6 @@
O membro '{0}' não acessa os dados da instância e pode ser marcado como estático
-
-
- Examinar manipuladores de eventos visíveis
-
-
-
-
- Foi detectado um método de manipulação de eventos público ou protegido. Os métodos de manipulação de eventos não devem ser expostos, a menos que absolutamente necessário.
-
-
-
-
- Considere tornar {0} não visível externamente
-
- Métodos de lacre que satisfazem interfaces privadas
diff --git a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.ru.xlf b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.ru.xlf
index 448210d28e..84d99ff546 100644
--- a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.ru.xlf
+++ b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.ru.xlf
@@ -1877,21 +1877,6 @@
Член "{0}" не обращается к данным экземпляров, поэтому его можно пометить как статический.
-
-
- Проверьте видимые обработчики событий
-
-
-
-
- Обнаружен общий или защищенный метод обработки событий. Такие методы следует предоставлять только в крайнем случае.
-
-
-
-
- Рекомендуется сделать "{0}" недоступным извне.
-
- Запечатайте методы, соответствующие частным интерфейсам
diff --git a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.tr.xlf b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.tr.xlf
index 4cae26ed1d..dad6cd5953 100644
--- a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.tr.xlf
+++ b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.tr.xlf
@@ -1877,21 +1877,6 @@
'{0}' adlı üye örnek verilerine erişmiyor ve statik olarak işaretlenebilir
-
-
- Görünür olay işleyicilerini gözden geçirin
-
-
-
-
- Genel veya korumalı bir olay işleme yöntemi algılandı. Olay işleme yöntemleri kesinlikle gerekli olmadıkça kullanıma sunulmamalıdır.
-
-
-
-
- '{0}' öğesini dışarıdan görünmez yapmayı deneyin
-
- Özel arabirimleri karşılayan mühürleme yöntemleri
diff --git a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.zh-Hans.xlf b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.zh-Hans.xlf
index bc0d05d550..b92391fd00 100644
--- a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.zh-Hans.xlf
+++ b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.zh-Hans.xlf
@@ -1877,21 +1877,6 @@
成员“{0}”不访问实例数据,可标记为 static
-
-
- 检查可见的事件处理程序
-
-
-
-
- 检测到公共或受保护的事件处理方法。除非绝对必要,否则不应公开事件处理方法。
-
-
-
-
- 请考虑将“{0}”设为对外部不可见
-
- 密封满足私有接口的方法
diff --git a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.zh-Hant.xlf b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.zh-Hant.xlf
index 48f76e8961..4b0b474dbf 100644
--- a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.zh-Hant.xlf
+++ b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/xlf/MicrosoftCodeQualityAnalyzersResources.zh-Hant.xlf
@@ -1877,21 +1877,6 @@
成員 '{0}' 不會存取執行個體資料,因而可標記為靜態
-
-
- 檢閱可見的事件處理常式
-
-
-
-
- 已偵測到公用或受保護的事件處理方法。除非絕對必要,否則不應公開事件處理方法。
-
-
-
-
- 請考慮對外隱藏 '{0}'
-
- 密封滿足私用介面的方法