From 7a460243e1bbaa500164701bd724544de1916e90 Mon Sep 17 00:00:00 2001 From: h3xds1nz Date: Mon, 31 Mar 2025 12:31:15 +0200 Subject: [PATCH 1/2] Fix IDE0073 for generated files --- .../src/Shared/MS/Internal/Generated/ToleranceTypeValidation.cs | 1 - .../src/WpfGfx/codegen/mcg/helpers/ManagedStyle.cs | 1 - .../src/WpfGfx/include/Generated/wgx_command_types.cs | 1 - .../src/WpfGfx/include/Generated/wgx_commands.cs | 1 - .../src/WpfGfx/include/Generated/wgx_misc.cs | 1 - .../src/WpfGfx/include/Generated/wgx_resource_types.cs | 1 - 6 files changed, 6 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/Generated/ToleranceTypeValidation.cs b/src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/Generated/ToleranceTypeValidation.cs index 699e242ab9a..69fccecc491 100644 --- a/src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/Generated/ToleranceTypeValidation.cs +++ b/src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/Generated/ToleranceTypeValidation.cs @@ -1,6 +1,5 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. // // diff --git a/src/Microsoft.DotNet.Wpf/src/WpfGfx/codegen/mcg/helpers/ManagedStyle.cs b/src/Microsoft.DotNet.Wpf/src/WpfGfx/codegen/mcg/helpers/ManagedStyle.cs index 71a5e9678a8..5f92852788e 100644 --- a/src/Microsoft.DotNet.Wpf/src/WpfGfx/codegen/mcg/helpers/ManagedStyle.cs +++ b/src/Microsoft.DotNet.Wpf/src/WpfGfx/codegen/mcg/helpers/ManagedStyle.cs @@ -53,7 +53,6 @@ public static string WriteFileHeader(string filename, string source) [[inline]] // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - // See the LICENSE file in the project root for more information. // // diff --git a/src/Microsoft.DotNet.Wpf/src/WpfGfx/include/Generated/wgx_command_types.cs b/src/Microsoft.DotNet.Wpf/src/WpfGfx/include/Generated/wgx_command_types.cs index b7eaeb313f1..586e274bd3e 100644 --- a/src/Microsoft.DotNet.Wpf/src/WpfGfx/include/Generated/wgx_command_types.cs +++ b/src/Microsoft.DotNet.Wpf/src/WpfGfx/include/Generated/wgx_command_types.cs @@ -1,6 +1,5 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. // // diff --git a/src/Microsoft.DotNet.Wpf/src/WpfGfx/include/Generated/wgx_commands.cs b/src/Microsoft.DotNet.Wpf/src/WpfGfx/include/Generated/wgx_commands.cs index 643be6e8fbd..4729bbfced2 100644 --- a/src/Microsoft.DotNet.Wpf/src/WpfGfx/include/Generated/wgx_commands.cs +++ b/src/Microsoft.DotNet.Wpf/src/WpfGfx/include/Generated/wgx_commands.cs @@ -1,6 +1,5 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. // // diff --git a/src/Microsoft.DotNet.Wpf/src/WpfGfx/include/Generated/wgx_misc.cs b/src/Microsoft.DotNet.Wpf/src/WpfGfx/include/Generated/wgx_misc.cs index c5757697a0e..2c5a72538c2 100644 --- a/src/Microsoft.DotNet.Wpf/src/WpfGfx/include/Generated/wgx_misc.cs +++ b/src/Microsoft.DotNet.Wpf/src/WpfGfx/include/Generated/wgx_misc.cs @@ -1,6 +1,5 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. // // diff --git a/src/Microsoft.DotNet.Wpf/src/WpfGfx/include/Generated/wgx_resource_types.cs b/src/Microsoft.DotNet.Wpf/src/WpfGfx/include/Generated/wgx_resource_types.cs index 55f16e1f90a..544bed32c93 100644 --- a/src/Microsoft.DotNet.Wpf/src/WpfGfx/include/Generated/wgx_resource_types.cs +++ b/src/Microsoft.DotNet.Wpf/src/WpfGfx/include/Generated/wgx_resource_types.cs @@ -1,6 +1,5 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. // // From 79b2fc82087337b9a753cf2c9d1898d174031092 Mon Sep 17 00:00:00 2001 From: h3xds1nz Date: Mon, 31 Mar 2025 12:31:37 +0200 Subject: [PATCH 2/2] Fix IDE0065 for CSP --- .../src/WpfGfx/tools/csp/CsPrimeParser.cs | 10 ++++------ .../src/WpfGfx/tools/csp/CsPrimeRuntime.cs | 5 ++--- .../src/WpfGfx/tools/csp/GlobalUsings.cs | 5 +++++ .../src/WpfGfx/tools/csp/MainClass.cs | 12 +++++------- .../src/WpfGfx/tools/csp/Project.cs | 12 +++++------- .../src/WpfGfx/tools/csp/TempDirectory.cs | 3 --- .../src/WpfGfx/tools/csp/csp.csproj | 1 + 7 files changed, 22 insertions(+), 26 deletions(-) create mode 100644 src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/GlobalUsings.cs diff --git a/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/CsPrimeParser.cs b/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/CsPrimeParser.cs index 675a93dc453..16f12b95203 100644 --- a/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/CsPrimeParser.cs +++ b/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/CsPrimeParser.cs @@ -11,14 +11,12 @@ // // +using System.Text.RegularExpressions; +using System.Collections; +using System.Text; + namespace MS.Internal.Csp { - using System; - using System.IO; - using System.Text; - using System.Text.RegularExpressions; - using System.Collections; - internal sealed class CsPrimeParser { private struct Position diff --git a/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/CsPrimeRuntime.cs b/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/CsPrimeRuntime.cs index 8ad64ce57ea..85ec34eb0f4 100644 --- a/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/CsPrimeRuntime.cs +++ b/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/CsPrimeRuntime.cs @@ -14,11 +14,10 @@ // provided to the project that Csp.exe will execute. // +using System.Text; + namespace MS.Internal.Csp { - using System; - using System.Text; - public sealed class CsPrimeRuntime { //------------------------------------------------------ diff --git a/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/GlobalUsings.cs b/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/GlobalUsings.cs new file mode 100644 index 00000000000..1c489bb0d62 --- /dev/null +++ b/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/GlobalUsings.cs @@ -0,0 +1,5 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +global using System.IO; +global using System; \ No newline at end of file diff --git a/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/MainClass.cs b/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/MainClass.cs index 748d1671428..0562bb08c50 100644 --- a/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/MainClass.cs +++ b/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/MainClass.cs @@ -19,15 +19,13 @@ // //------------------------------------------------------------------------------ +using System.CodeDom.Compiler; +using System.Collections; +using System.Diagnostics; +using System.Text; + namespace MS.Internal.Csp { - using System; - using System.Collections; - using System.Diagnostics; - using System.IO; - using System.Text; - using System.CodeDom.Compiler; - internal sealed class MainClass { // Parameters affecting csp.exe as a whole. diff --git a/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/Project.cs b/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/Project.cs index 921bee6ea29..e77dfcebf6c 100644 --- a/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/Project.cs +++ b/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/Project.cs @@ -10,15 +10,13 @@ // a set of "C# prime" files, then executes the project. // +using System.CodeDom.Compiler; +using System.Collections; +using System.Reflection; +using System.Text; + namespace MS.Internal.Csp { - using System; - using System.IO; - using System.Text; - using System.Collections; - using System.Reflection; - using System.CodeDom.Compiler; - // This kind of exception is thrown when csp detects an // error in the project. public class CspProjectException : ApplicationException diff --git a/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/TempDirectory.cs b/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/TempDirectory.cs index 24b3d96d082..1838de0e683 100644 --- a/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/TempDirectory.cs +++ b/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/TempDirectory.cs @@ -13,9 +13,6 @@ namespace MS.Internal.Csp { - using System; - using System.IO; - internal class TempDirectory : IDisposable { //------------------------------------------------------ diff --git a/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/csp.csproj b/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/csp.csproj index 30ab1ea726e..3d19f01fc11 100644 --- a/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/csp.csproj +++ b/src/Microsoft.DotNet.Wpf/src/WpfGfx/tools/csp/csp.csproj @@ -10,6 +10,7 @@ +