From 6b009c11e3ba809afe2621392215cbcf961f285c Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Tue, 10 Nov 2020 03:15:04 +0000 Subject: [PATCH] Remove unnecessary usings part 2 (#14017) https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005 --- .../CommonUtils.cs | 2 -- .../CoreCLR/Stubs.cs | 1 - .../CounterSample.cs | 6 ------ .../CounterSet.cs | 2 -- .../GetCounterCommand.cs | 14 +------------- .../GetEventCommand.cs | 1 - .../NewWinEventCommand.cs | 1 - .../PdhHelper.cs | 2 -- .../PdhSafeHandle.cs | 2 -- 9 files changed, 1 insertion(+), 30 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/CommonUtils.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/CommonUtils.cs index bd99ef7aff..91f46955a3 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/CommonUtils.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/CommonUtils.cs @@ -2,9 +2,7 @@ // Licensed under the MIT License. using System; -using System.Collections; using System.Diagnostics; -using System.Globalization; using System.Reflection; using System.Resources; using System.Runtime.InteropServices; diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/CoreCLR/Stubs.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/CoreCLR/Stubs.cs index 00981ad884..9e320e610d 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/CoreCLR/Stubs.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/CoreCLR/Stubs.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. #if CORECLR -using System.ComponentModel; namespace System.Diagnostics { diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSample.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSample.cs index b7d487701b..0717be5ff3 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSample.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSample.cs @@ -2,16 +2,10 @@ // Licensed under the MIT License. using System; -using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Reflection; using System.Resources; -using Microsoft.Powershell.Commands.GetCounter.PdhNative; - namespace Microsoft.PowerShell.Commands.GetCounter { public class PerformanceCounterSample diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSet.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSet.cs index cece3bffb9..a8c5b8a74d 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSet.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSet.cs @@ -2,10 +2,8 @@ // Licensed under the MIT License. using System; -using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; -using System.ComponentModel; using System.Diagnostics; namespace Microsoft.PowerShell.Commands.GetCounter diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs index 978b449dbb..bbed3827d5 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs @@ -2,29 +2,17 @@ // Licensed under the MIT License. using System; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.Collections.Specialized; -using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; -using System.IO; using System.Management.Automation; -using System.Management.Automation.Runspaces; -using System.Net; -using System.Reflection; using System.Resources; -using System.Security; -using System.Security.Principal; -using System.Text; using System.Threading; -using System.Xml; - +using Microsoft.Powershell.Commands.GetCounter.PdhNative; using Microsoft.PowerShell.Commands.Diagnostics.Common; using Microsoft.PowerShell.Commands.GetCounter; -using Microsoft.Powershell.Commands.GetCounter.PdhNative; namespace Microsoft.PowerShell.Commands { diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs index 09ac6153a5..c6d794a436 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs @@ -11,7 +11,6 @@ using System.Diagnostics.Eventing.Reader; using System.Globalization; using System.Management.Automation; using System.Net; -using System.Reflection; using System.Resources; using System.Security.Principal; using System.Text; diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs index e9f720d2e1..f302d867ee 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs @@ -9,7 +9,6 @@ using System.Diagnostics.Eventing.Reader; using System.Globalization; using System.IO; using System.Management.Automation; -using System.Reflection; using System.Resources; using System.Xml; diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs index c269937d37..541aeabe7c 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs @@ -2,13 +2,11 @@ // Licensed under the MIT License. using System; -using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Diagnostics; using System.Globalization; using System.Runtime.InteropServices; -using System.Runtime.InteropServices.ComTypes; using Microsoft.PowerShell.Commands.GetCounter; using Microsoft.Win32; diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/PdhSafeHandle.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/PdhSafeHandle.cs index 14607db670..2fc58cc00e 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/PdhSafeHandle.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/PdhSafeHandle.cs @@ -4,8 +4,6 @@ using System; using System.Runtime.InteropServices; -using System.Runtime.ConstrainedExecution; - namespace Microsoft.Powershell.Commands.GetCounter.PdhNative { internal sealed class PdhSafeDataSourceHandle : SafeHandle