From f4ffae4eaa9009f0b27aac03319e6d4e96a7e4ae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 20:14:35 +0000 Subject: [PATCH 01/15] Bump MSTest in /csharp/roslyn-sdk/Tutorials/MakeConst/MakeConst.Test Bumps [MSTest](https://github.com/microsoft/testfx) from 3.3.0 to 3.3.1. - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md) - [Commits](https://github.com/microsoft/testfx/compare/v3.3.0...v3.3.1) --- updated-dependencies: - dependency-name: MSTest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .../Tutorials/MakeConst/MakeConst.Test/MakeConst.Test.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp/roslyn-sdk/Tutorials/MakeConst/MakeConst.Test/MakeConst.Test.csproj b/csharp/roslyn-sdk/Tutorials/MakeConst/MakeConst.Test/MakeConst.Test.csproj index a54f6c6df95..5d66b4d6496 100644 --- a/csharp/roslyn-sdk/Tutorials/MakeConst/MakeConst.Test/MakeConst.Test.csproj +++ b/csharp/roslyn-sdk/Tutorials/MakeConst/MakeConst.Test/MakeConst.Test.csproj @@ -8,7 +8,7 @@ - + From 6a8b6bb80e6957d9a9db15a3da1cff681c3236d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 20:17:35 +0000 Subject: [PATCH 02/15] Bump MSTest Bumps [MSTest](https://github.com/microsoft/testfx) from 3.3.0 to 3.3.1. - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md) - [Commits](https://github.com/microsoft/testfx/compare/v3.3.0...v3.3.1) --- updated-dependencies: - dependency-name: MSTest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .../MathService.Tests/MathService.Tests.fsproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/getting-started/unit-testing-with-fsharp-mstest/MathService.Tests/MathService.Tests.fsproj b/core/getting-started/unit-testing-with-fsharp-mstest/MathService.Tests/MathService.Tests.fsproj index 13f127f0682..f3808d8bd8f 100644 --- a/core/getting-started/unit-testing-with-fsharp-mstest/MathService.Tests/MathService.Tests.fsproj +++ b/core/getting-started/unit-testing-with-fsharp-mstest/MathService.Tests/MathService.Tests.fsproj @@ -12,7 +12,7 @@ - + From a46f396241c67188adb3d00aba76ded1eb017b11 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 20:18:05 +0000 Subject: [PATCH 03/15] Bump MSTest.TestFramework Bumps [MSTest.TestFramework](https://github.com/microsoft/testfx) from 3.2.2 to 3.3.1. - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md) - [Commits](https://github.com/microsoft/testfx/compare/v3.2.2...v3.3.1) --- updated-dependencies: - dependency-name: MSTest.TestFramework dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .../PrimeService.Tests/PrimeService.Tests.vbproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/getting-started/unit-testing-vb-mstest/PrimeService.Tests/PrimeService.Tests.vbproj b/core/getting-started/unit-testing-vb-mstest/PrimeService.Tests/PrimeService.Tests.vbproj index 5cd8419ab1f..4523f09c9d0 100644 --- a/core/getting-started/unit-testing-vb-mstest/PrimeService.Tests/PrimeService.Tests.vbproj +++ b/core/getting-started/unit-testing-vb-mstest/PrimeService.Tests/PrimeService.Tests.vbproj @@ -8,7 +8,7 @@ - + From 6abd3670872446ec4ba6c07ede8f418d76bf21bf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 20:20:25 +0000 Subject: [PATCH 04/15] Bump System.Drawing.Common in /csharp/parallel/ParallelExtensionsExtras Bumps [System.Drawing.Common](https://github.com/dotnet/winforms) from 8.0.3 to 8.0.4. - [Release notes](https://github.com/dotnet/winforms/releases) - [Changelog](https://github.com/dotnet/winforms/blob/main/docs/release-activity.md) - [Commits](https://github.com/dotnet/winforms/compare/v8.0.3...v8.0.4) --- updated-dependencies: - dependency-name: System.Drawing.Common dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .../ParallelExtensionsExtras/ParallelExtensionsExtras.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp/parallel/ParallelExtensionsExtras/ParallelExtensionsExtras.csproj b/csharp/parallel/ParallelExtensionsExtras/ParallelExtensionsExtras.csproj index 0cef59ed59e..c52bf67e5c2 100644 --- a/csharp/parallel/ParallelExtensionsExtras/ParallelExtensionsExtras.csproj +++ b/csharp/parallel/ParallelExtensionsExtras/ParallelExtensionsExtras.csproj @@ -9,7 +9,7 @@ - + From 35572fa18f5678919d568f9b240ae9910a2240c2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 20:29:40 +0000 Subject: [PATCH 05/15] Bump MSTest.TestAdapter in /csharp/unit-testing/MSTest.Project Bumps [MSTest.TestAdapter](https://github.com/microsoft/testfx) from 3.2.2 to 3.3.1. - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md) - [Commits](https://github.com/microsoft/testfx/compare/v3.2.2...v3.3.1) --- updated-dependencies: - dependency-name: MSTest.TestAdapter dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- csharp/unit-testing/MSTest.Project/MSTest.Project.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp/unit-testing/MSTest.Project/MSTest.Project.csproj b/csharp/unit-testing/MSTest.Project/MSTest.Project.csproj index d3d506f33db..6c457cd014e 100644 --- a/csharp/unit-testing/MSTest.Project/MSTest.Project.csproj +++ b/csharp/unit-testing/MSTest.Project/MSTest.Project.csproj @@ -8,7 +8,7 @@ - + all From 8270994b3988e0b61d65118ec17aaee812c7e99c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 20:31:46 +0000 Subject: [PATCH 06/15] Bump Microsoft.AspNetCore.Mvc.NewtonsoftJson Bumps [Microsoft.AspNetCore.Mvc.NewtonsoftJson](https://github.com/dotnet/aspnetcore) from 8.0.3 to 8.0.4. - [Release notes](https://github.com/dotnet/aspnetcore/releases) - [Changelog](https://github.com/dotnet/aspnetcore/blob/main/docs/ReleasePlanning.md) - [Commits](https://github.com/dotnet/aspnetcore/compare/v8.0.3...v8.0.4) --- updated-dependencies: - dependency-name: Microsoft.AspNetCore.Mvc.NewtonsoftJson dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- core/diagnostics/DiagnosticScenarios/DiagnosticScenarios.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/diagnostics/DiagnosticScenarios/DiagnosticScenarios.csproj b/core/diagnostics/DiagnosticScenarios/DiagnosticScenarios.csproj index 90df2998c42..62a4d26d736 100644 --- a/core/diagnostics/DiagnosticScenarios/DiagnosticScenarios.csproj +++ b/core/diagnostics/DiagnosticScenarios/DiagnosticScenarios.csproj @@ -5,7 +5,7 @@ - + From bb0df6b0fd98e02e5ee428383e8b67066b7277b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 20:43:22 +0000 Subject: [PATCH 07/15] Bump Azure.Identity in /azure/sdk-identity-resources-storage Bumps [Azure.Identity](https://github.com/Azure/azure-sdk-for-net) from 1.10.4 to 1.11.0. - [Release notes](https://github.com/Azure/azure-sdk-for-net/releases) - [Commits](https://github.com/Azure/azure-sdk-for-net/compare/Azure.Identity_1.10.4...Azure.Identity_1.11.0) --- updated-dependencies: - dependency-name: Azure.Identity dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .../AzureIdentityStorageExample.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure/sdk-identity-resources-storage/AzureIdentityStorageExample.csproj b/azure/sdk-identity-resources-storage/AzureIdentityStorageExample.csproj index a537b14df31..ae88358e9e4 100644 --- a/azure/sdk-identity-resources-storage/AzureIdentityStorageExample.csproj +++ b/azure/sdk-identity-resources-storage/AzureIdentityStorageExample.csproj @@ -20,7 +20,7 @@ - + From c5cf01cd349161a42597449d1aca2ada278a6668 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 20:44:04 +0000 Subject: [PATCH 08/15] Bump Microsoft.Windows.Compatibility Bumps [Microsoft.Windows.Compatibility](https://github.com/dotnet/windowsdesktop) from 8.0.3 to 8.0.4. - [Release notes](https://github.com/dotnet/windowsdesktop/releases) - [Commits](https://github.com/dotnet/windowsdesktop/compare/v8.0.3...v8.0.4) --- updated-dependencies: - dependency-name: Microsoft.Windows.Compatibility dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .../net5-windows/cs/MatchingGame/MatchingGame.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windowsforms/matching-game/net5-windows/cs/MatchingGame/MatchingGame.csproj b/windowsforms/matching-game/net5-windows/cs/MatchingGame/MatchingGame.csproj index 26c61427b2e..7c568c4f1bf 100644 --- a/windowsforms/matching-game/net5-windows/cs/MatchingGame/MatchingGame.csproj +++ b/windowsforms/matching-game/net5-windows/cs/MatchingGame/MatchingGame.csproj @@ -17,7 +17,7 @@ 1.2.0.3 - + From 08fb46d9f2bc2d06079b38effbff4f0cdde14de2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 20:48:07 +0000 Subject: [PATCH 09/15] Bump Microsoft.Windows.Compatibility Bumps [Microsoft.Windows.Compatibility](https://github.com/dotnet/windowsdesktop) from 8.0.3 to 8.0.4. - [Release notes](https://github.com/dotnet/windowsdesktop/releases) - [Commits](https://github.com/dotnet/windowsdesktop/compare/v8.0.3...v8.0.4) --- updated-dependencies: - dependency-name: Microsoft.Windows.Compatibility dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .../CSWinFormDataGridView/CSWinFormDataGridView.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windowsforms/datagridview/CSWinFormDataGridView/CSWinFormDataGridView.csproj b/windowsforms/datagridview/CSWinFormDataGridView/CSWinFormDataGridView.csproj index 4a716064bc1..85242896307 100644 --- a/windowsforms/datagridview/CSWinFormDataGridView/CSWinFormDataGridView.csproj +++ b/windowsforms/datagridview/CSWinFormDataGridView/CSWinFormDataGridView.csproj @@ -13,7 +13,7 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame/App.config b/windowsforms/matching-game/net5-windows/vb/MatchingGame/App.config deleted file mode 100644 index c0afc83c0dc..00000000000 --- a/windowsforms/matching-game/net5-windows/vb/MatchingGame/App.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame/MatchingGame.vbproj b/windowsforms/matching-game/net5-windows/vb/MatchingGame/MatchingGame.vbproj deleted file mode 100644 index 015d5af220a..00000000000 --- a/windowsforms/matching-game/net5-windows/vb/MatchingGame/MatchingGame.vbproj +++ /dev/null @@ -1,71 +0,0 @@ - - - - WinExe - net5.0-windows - true - false - MatchingGame - MatchingGame - - On - Binary - Off - On - MatchingGame.My.MyApplication - WindowsForms - - - - - - - - - - - - - - - - - - - - - - - 1.2.0.3 - - - - - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - True - Settings.settings - True - - - - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - - - True - True - Resources.resx - - - - - diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame/My Project/AssemblyInfo.vb b/windowsforms/matching-game/net5-windows/vb/MatchingGame/My Project/AssemblyInfo.vb deleted file mode 100644 index 15b4a640503..00000000000 --- a/windowsforms/matching-game/net5-windows/vb/MatchingGame/My Project/AssemblyInfo.vb +++ /dev/null @@ -1,35 +0,0 @@ -Imports System -Imports System.Reflection -Imports System.Runtime.InteropServices - -' General Information about an assembly is controlled through the following -' set of attributes. Change these attribute values to modify the information -' associated with an assembly. - -' Review the values of the assembly attributes - - - - - - - - - - -'The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: -' - - - diff --git a/windowsforms/matching-game/net5-windows/vb/readme.md b/windowsforms/matching-game/net5-windows/vb/readme.md deleted file mode 100644 index 9489fa1c839..00000000000 --- a/windowsforms/matching-game/net5-windows/vb/readme.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -languages: -- vb -products: -- dotnet -- windows-forms -page_type: sample -name: "Matching Game Sample (.NET 5 Visual Basic)" -urlFragment: "matching-game-net-vb" -description: "A simple matching game" ---- -# Matching game - -This sample demonstrates a simple memory game where you try to match tiles in the fewest amount of moves possible. This sample was migrated from the [.NET Framework version](https://github.com/dotnet/samples/tree/main/windowsforms/matching-game/net45/vb). - -## Prerequisites - -- [Visual Studio 2019 version 16.8](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=inline+link&utm_content=download+vs2019+desktopguide+winforms) - - - Enable the [Visual Studio Desktop workload](https://docs.microsoft.com/visualstudio/install/modify-visual-studio?view=vs-2019&preserve-view=true#modify-workloads). - - - Enable the [.NET 5 individual component](https://docs.microsoft.com/visualstudio/install/modify-visual-studio?view=vs-2019&preserve-view=true#modify-individual-components). diff --git a/windowsforms/matching-game/net5-windows/cs/MatchingGame.Logic/Game.cs b/windowsforms/matching-game/net8-windows/cs/MatchingGame.Logic/Game.cs similarity index 97% rename from windowsforms/matching-game/net5-windows/cs/MatchingGame.Logic/Game.cs rename to windowsforms/matching-game/net8-windows/cs/MatchingGame.Logic/Game.cs index 0ecd796c40a..f2cfab62d28 100644 --- a/windowsforms/matching-game/net5-windows/cs/MatchingGame.Logic/Game.cs +++ b/windowsforms/matching-game/net8-windows/cs/MatchingGame.Logic/Game.cs @@ -87,8 +87,8 @@ public char GetCard(int w, int h) public bool IsOpen(int w, int h) { - var v = GetIndex(w, h); - return _openCards[v]; + var cardIndex = GetIndex(w, h); + return _openCards[cardIndex]; } public bool CompleteTurn() diff --git a/windowsforms/matching-game/net5-windows/cs/MatchingGame.Logic/GameSettings.cs b/windowsforms/matching-game/net8-windows/cs/MatchingGame.Logic/GameSettings.cs similarity index 100% rename from windowsforms/matching-game/net5-windows/cs/MatchingGame.Logic/GameSettings.cs rename to windowsforms/matching-game/net8-windows/cs/MatchingGame.Logic/GameSettings.cs diff --git a/windowsforms/matching-game/net8-windows/cs/MatchingGame.Logic/MatchingGame.Logic.csproj b/windowsforms/matching-game/net8-windows/cs/MatchingGame.Logic/MatchingGame.Logic.csproj new file mode 100644 index 00000000000..6647e09a21f --- /dev/null +++ b/windowsforms/matching-game/net8-windows/cs/MatchingGame.Logic/MatchingGame.Logic.csproj @@ -0,0 +1,16 @@ + + + net8.0 + Library + false + MatchingGame.Logic + MatchingGame.Logic + Copyright © 2018 + 1.0.0.0 + 1.0.0.0 + + + + + + \ No newline at end of file diff --git a/windowsforms/matching-game/net8-windows/cs/MatchingGame.Logic/Properties/AssemblyInfo.cs b/windowsforms/matching-game/net8-windows/cs/MatchingGame.Logic/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..a6ffda24f8b --- /dev/null +++ b/windowsforms/matching-game/net8-windows/cs/MatchingGame.Logic/Properties/AssemblyInfo.cs @@ -0,0 +1,13 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("36b3e6e2-a9ae-4924-89ae-7f0120ce08bd")] diff --git a/windowsforms/matching-game/net5-windows/cs/MatchingGame.sln b/windowsforms/matching-game/net8-windows/cs/MatchingGame.sln similarity index 91% rename from windowsforms/matching-game/net5-windows/cs/MatchingGame.sln rename to windowsforms/matching-game/net8-windows/cs/MatchingGame.sln index 6ce5320603d..5c9963fa389 100644 --- a/windowsforms/matching-game/net5-windows/cs/MatchingGame.sln +++ b/windowsforms/matching-game/net8-windows/cs/MatchingGame.sln @@ -1,11 +1,11 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.28315.86 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MatchingGame", "MatchingGame\MatchingGame.csproj", "{33E7C299-4ABD-4224-9335-3BC70512A1B3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MatchingGame", "MatchingGame\MatchingGame.csproj", "{33E7C299-4ABD-4224-9335-3BC70512A1B3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MatchingGame.Logic", "MatchingGame.Logic\MatchingGame.Logic.csproj", "{36B3E6E2-A9AE-4924-89AE-7F0120CE08BD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MatchingGame.Logic", "MatchingGame.Logic\MatchingGame.Logic.csproj", "{36B3E6E2-A9AE-4924-89AE-7F0120CE08BD}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/windowsforms/matching-game/net5-windows/cs/MatchingGame/MainForm.Designer.cs b/windowsforms/matching-game/net8-windows/cs/MatchingGame/MainForm.Designer.cs similarity index 88% rename from windowsforms/matching-game/net5-windows/cs/MatchingGame/MainForm.Designer.cs rename to windowsforms/matching-game/net8-windows/cs/MatchingGame/MainForm.Designer.cs index 5dcb2020499..9c7c5df3e47 100644 --- a/windowsforms/matching-game/net5-windows/cs/MatchingGame/MainForm.Designer.cs +++ b/windowsforms/matching-game/net8-windows/cs/MatchingGame/MainForm.Designer.cs @@ -76,23 +76,23 @@ private void InitializeComponent() this.tableLayoutPanel1.Controls.Add(this.label2, 1, 0); this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel1.Location = new System.Drawing.Point(20, 60); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 4; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(534, 511); + this.tableLayoutPanel1.Size = new System.Drawing.Size(494, 431); this.tableLayoutPanel1.TabIndex = 0; // // label16 // this.label16.Dock = System.Windows.Forms.DockStyle.Fill; this.label16.Font = new System.Drawing.Font("Webdings", 72F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2))); - this.label16.Location = new System.Drawing.Point(404, 383); + this.label16.Location = new System.Drawing.Point(374, 323); this.label16.Name = "label16"; - this.label16.Size = new System.Drawing.Size(125, 126); + this.label16.Size = new System.Drawing.Size(115, 106); this.label16.TabIndex = 15; this.label16.Text = "c"; this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -102,9 +102,9 @@ private void InitializeComponent() // this.label15.Dock = System.Windows.Forms.DockStyle.Fill; this.label15.Font = new System.Drawing.Font("Webdings", 72F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2))); - this.label15.Location = new System.Drawing.Point(271, 383); + this.label15.Location = new System.Drawing.Point(251, 323); this.label15.Name = "label15"; - this.label15.Size = new System.Drawing.Size(125, 126); + this.label15.Size = new System.Drawing.Size(115, 106); this.label15.TabIndex = 14; this.label15.Text = "c"; this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -114,9 +114,9 @@ private void InitializeComponent() // this.label14.Dock = System.Windows.Forms.DockStyle.Fill; this.label14.Font = new System.Drawing.Font("Webdings", 72F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2))); - this.label14.Location = new System.Drawing.Point(138, 383); + this.label14.Location = new System.Drawing.Point(128, 323); this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(125, 126); + this.label14.Size = new System.Drawing.Size(115, 106); this.label14.TabIndex = 13; this.label14.Text = "c"; this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -126,9 +126,9 @@ private void InitializeComponent() // this.label13.Dock = System.Windows.Forms.DockStyle.Fill; this.label13.Font = new System.Drawing.Font("Webdings", 72F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2))); - this.label13.Location = new System.Drawing.Point(5, 383); + this.label13.Location = new System.Drawing.Point(5, 323); this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(125, 126); + this.label13.Size = new System.Drawing.Size(115, 106); this.label13.TabIndex = 12; this.label13.Text = "c"; this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -138,9 +138,9 @@ private void InitializeComponent() // this.label12.Dock = System.Windows.Forms.DockStyle.Fill; this.label12.Font = new System.Drawing.Font("Webdings", 72F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2))); - this.label12.Location = new System.Drawing.Point(404, 256); + this.label12.Location = new System.Drawing.Point(374, 216); this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(125, 125); + this.label12.Size = new System.Drawing.Size(115, 105); this.label12.TabIndex = 11; this.label12.Text = "c"; this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -150,9 +150,9 @@ private void InitializeComponent() // this.label11.Dock = System.Windows.Forms.DockStyle.Fill; this.label11.Font = new System.Drawing.Font("Webdings", 72F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2))); - this.label11.Location = new System.Drawing.Point(271, 256); + this.label11.Location = new System.Drawing.Point(251, 216); this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(125, 125); + this.label11.Size = new System.Drawing.Size(115, 105); this.label11.TabIndex = 10; this.label11.Text = "c"; this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -162,9 +162,9 @@ private void InitializeComponent() // this.label10.Dock = System.Windows.Forms.DockStyle.Fill; this.label10.Font = new System.Drawing.Font("Webdings", 72F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2))); - this.label10.Location = new System.Drawing.Point(138, 256); + this.label10.Location = new System.Drawing.Point(128, 216); this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(125, 125); + this.label10.Size = new System.Drawing.Size(115, 105); this.label10.TabIndex = 9; this.label10.Text = "c"; this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -174,9 +174,9 @@ private void InitializeComponent() // this.label9.Dock = System.Windows.Forms.DockStyle.Fill; this.label9.Font = new System.Drawing.Font("Webdings", 72F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2))); - this.label9.Location = new System.Drawing.Point(5, 256); + this.label9.Location = new System.Drawing.Point(5, 216); this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(125, 125); + this.label9.Size = new System.Drawing.Size(115, 105); this.label9.TabIndex = 8; this.label9.Text = "c"; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -186,9 +186,9 @@ private void InitializeComponent() // this.label8.Dock = System.Windows.Forms.DockStyle.Fill; this.label8.Font = new System.Drawing.Font("Webdings", 72F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2))); - this.label8.Location = new System.Drawing.Point(404, 129); + this.label8.Location = new System.Drawing.Point(374, 109); this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(125, 125); + this.label8.Size = new System.Drawing.Size(115, 105); this.label8.TabIndex = 7; this.label8.Text = "c"; this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -198,9 +198,9 @@ private void InitializeComponent() // this.label7.Dock = System.Windows.Forms.DockStyle.Fill; this.label7.Font = new System.Drawing.Font("Webdings", 72F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2))); - this.label7.Location = new System.Drawing.Point(271, 129); + this.label7.Location = new System.Drawing.Point(251, 109); this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(125, 125); + this.label7.Size = new System.Drawing.Size(115, 105); this.label7.TabIndex = 6; this.label7.Text = "c"; this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -210,9 +210,9 @@ private void InitializeComponent() // this.label6.Dock = System.Windows.Forms.DockStyle.Fill; this.label6.Font = new System.Drawing.Font("Webdings", 72F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2))); - this.label6.Location = new System.Drawing.Point(138, 129); + this.label6.Location = new System.Drawing.Point(128, 109); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(125, 125); + this.label6.Size = new System.Drawing.Size(115, 105); this.label6.TabIndex = 5; this.label6.Text = "c"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -222,9 +222,9 @@ private void InitializeComponent() // this.label5.Dock = System.Windows.Forms.DockStyle.Fill; this.label5.Font = new System.Drawing.Font("Webdings", 72F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2))); - this.label5.Location = new System.Drawing.Point(5, 129); + this.label5.Location = new System.Drawing.Point(5, 109); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(125, 125); + this.label5.Size = new System.Drawing.Size(115, 105); this.label5.TabIndex = 4; this.label5.Text = "c"; this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -234,9 +234,9 @@ private void InitializeComponent() // this.label4.Dock = System.Windows.Forms.DockStyle.Fill; this.label4.Font = new System.Drawing.Font("Webdings", 72F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2))); - this.label4.Location = new System.Drawing.Point(404, 2); + this.label4.Location = new System.Drawing.Point(374, 2); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(125, 125); + this.label4.Size = new System.Drawing.Size(115, 105); this.label4.TabIndex = 3; this.label4.Text = "c"; this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -246,9 +246,9 @@ private void InitializeComponent() // this.label3.Dock = System.Windows.Forms.DockStyle.Fill; this.label3.Font = new System.Drawing.Font("Webdings", 72F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2))); - this.label3.Location = new System.Drawing.Point(271, 2); + this.label3.Location = new System.Drawing.Point(251, 2); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(125, 125); + this.label3.Size = new System.Drawing.Size(115, 105); this.label3.TabIndex = 2; this.label3.Text = "c"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -258,9 +258,9 @@ private void InitializeComponent() // this.label2.Dock = System.Windows.Forms.DockStyle.Fill; this.label2.Font = new System.Drawing.Font("Webdings", 72F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2))); - this.label2.Location = new System.Drawing.Point(138, 2); + this.label2.Location = new System.Drawing.Point(128, 2); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(125, 125); + this.label2.Size = new System.Drawing.Size(115, 105); this.label2.TabIndex = 1; this.label2.Text = "c"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -272,25 +272,26 @@ private void InitializeComponent() this.label1.Font = new System.Drawing.Font("Webdings", 72F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2))); this.label1.Location = new System.Drawing.Point(5, 2); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(125, 125); + this.label1.Size = new System.Drawing.Size(115, 105); this.label1.TabIndex = 0; this.label1.Text = "c"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label1.Click += new System.EventHandler(this.label_Click); // - // timer1 + // closeCardTimer // this.closeCardTimer.Interval = 750; this.closeCardTimer.Tick += new System.EventHandler(this.closeCardTimer_Tick); // - // Form1 + // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(534, 511); this.Controls.Add(this.tableLayoutPanel1); - this.Name = "Form1"; + this.Name = "MainForm"; this.Text = "Matching Game"; + this.Load += new System.EventHandler(this.MainForm_Load); this.tableLayoutPanel1.ResumeLayout(false); this.ResumeLayout(false); diff --git a/windowsforms/matching-game/net5-windows/cs/MatchingGame/MainForm.cs b/windowsforms/matching-game/net8-windows/cs/MatchingGame/MainForm.cs similarity index 97% rename from windowsforms/matching-game/net5-windows/cs/MatchingGame/MainForm.cs rename to windowsforms/matching-game/net8-windows/cs/MatchingGame/MainForm.cs index 5df9e28c564..2f4bb079c01 100644 --- a/windowsforms/matching-game/net5-windows/cs/MatchingGame/MainForm.cs +++ b/windowsforms/matching-game/net8-windows/cs/MatchingGame/MainForm.cs @@ -13,7 +13,6 @@ public partial class MainForm : MetroForm public MainForm() { InitializeComponent(); - StartNewGame(); } private void StartNewGame() @@ -73,13 +72,6 @@ private void label_Click(object sender, EventArgs e) } } - private void closeCardTimer_Tick(object sender, EventArgs e) - { - closeCardTimer.Stop(); - _game.CloseCards(); - UpdateCards(); - } - private void CheckForWinner() { if (!_game.IsComplete()) @@ -100,5 +92,17 @@ private void CheckForWinner() MessageBox.Show(text, "Congratulations!"); StartNewGame(); } + + private void closeCardTimer_Tick(object sender, EventArgs e) + { + closeCardTimer.Stop(); + _game.CloseCards(); + UpdateCards(); + } + + private void MainForm_Load(object sender, EventArgs e) + { + StartNewGame(); + } } } diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame/MainForm.resx b/windowsforms/matching-game/net8-windows/cs/MatchingGame/MainForm.resx similarity index 100% rename from windowsforms/matching-game/net5-windows/vb/MatchingGame/MainForm.resx rename to windowsforms/matching-game/net8-windows/cs/MatchingGame/MainForm.resx diff --git a/windowsforms/matching-game/net8-windows/cs/MatchingGame/MatchingGame.csproj b/windowsforms/matching-game/net8-windows/cs/MatchingGame/MatchingGame.csproj new file mode 100644 index 00000000000..2dc183ddf42 --- /dev/null +++ b/windowsforms/matching-game/net8-windows/cs/MatchingGame/MatchingGame.csproj @@ -0,0 +1,18 @@ + + + net8.0-windows + WinExe + false + true + true + + + + + + + + + + + \ No newline at end of file diff --git a/windowsforms/matching-game/net5-windows/cs/MatchingGame/Program.cs b/windowsforms/matching-game/net8-windows/cs/MatchingGame/Program.cs similarity index 100% rename from windowsforms/matching-game/net5-windows/cs/MatchingGame/Program.cs rename to windowsforms/matching-game/net8-windows/cs/MatchingGame/Program.cs diff --git a/windowsforms/matching-game/net5-windows/cs/MatchingGame/Properties/Resources.Designer.cs b/windowsforms/matching-game/net8-windows/cs/MatchingGame/Properties/Resources.Designer.cs similarity index 89% rename from windowsforms/matching-game/net5-windows/cs/MatchingGame/Properties/Resources.Designer.cs rename to windowsforms/matching-game/net8-windows/cs/MatchingGame/Properties/Resources.Designer.cs index 9b518efe461..59fb7295edf 100644 --- a/windowsforms/matching-game/net5-windows/cs/MatchingGame/Properties/Resources.Designer.cs +++ b/windowsforms/matching-game/net8-windows/cs/MatchingGame/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace MatchingGame.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -59,14 +59,5 @@ internal Resources() { resourceCulture = value; } } - - /// - /// Looks up a localized string similar to a. - /// - internal static string String1 { - get { - return ResourceManager.GetString("String1", resourceCulture); - } - } } } diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame.Logic/My Project/Resources.resx b/windowsforms/matching-game/net8-windows/cs/MatchingGame/Properties/Resources.resx similarity index 100% rename from windowsforms/matching-game/net5-windows/vb/MatchingGame.Logic/My Project/Resources.resx rename to windowsforms/matching-game/net8-windows/cs/MatchingGame/Properties/Resources.resx diff --git a/windowsforms/matching-game/net5-windows/cs/MatchingGame/Properties/Settings.Designer.cs b/windowsforms/matching-game/net8-windows/cs/MatchingGame/Properties/Settings.Designer.cs similarity index 97% rename from windowsforms/matching-game/net5-windows/cs/MatchingGame/Properties/Settings.Designer.cs rename to windowsforms/matching-game/net8-windows/cs/MatchingGame/Properties/Settings.Designer.cs index 7ff0d87c5ba..57568955d47 100644 --- a/windowsforms/matching-game/net5-windows/cs/MatchingGame/Properties/Settings.Designer.cs +++ b/windowsforms/matching-game/net8-windows/cs/MatchingGame/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace MatchingGame.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.9.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/windowsforms/matching-game/net5-windows/cs/MatchingGame/Properties/Settings.settings b/windowsforms/matching-game/net8-windows/cs/MatchingGame/Properties/Settings.settings similarity index 100% rename from windowsforms/matching-game/net5-windows/cs/MatchingGame/Properties/Settings.settings rename to windowsforms/matching-game/net8-windows/cs/MatchingGame/Properties/Settings.settings diff --git a/windowsforms/matching-game/net8-windows/cs/readme.md b/windowsforms/matching-game/net8-windows/cs/readme.md new file mode 100644 index 00000000000..6b15715904b --- /dev/null +++ b/windowsforms/matching-game/net8-windows/cs/readme.md @@ -0,0 +1,21 @@ +--- +languages: +- csharp +products: +- dotnet +- dotnet-core +- windows-forms +page_type: sample +name: "Matching Game Sample (.NET 8 C#)" +urlFragment: "matching-game-net-csharp" +description: "A simple matching game written for Windows Forms" +--- +# Matching game + +This sample demonstrates a simple memory game where you try to match tiles in the fewest amount of moves possible. This sample was migrated from the [.NET Framework version](https://github.com/dotnet/samples/tree/main/windowsforms/matching-game/net45/cs). + +## Prerequisites + +- [Visual Studio 2022 version 17.8](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=learn.microsoft.com&utm_campaign=inline+link&utm_content=download+vs2022+desktopguide+winforms+migration) + + - Enable the [Visual Studio Desktop workload](https://learn.microsoft.com/visualstudio/install/modify-visual-studio?view=vs-2022&preserve-view=true#modify-workloads). diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame.Logic/Game.vb b/windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/Game.vb similarity index 98% rename from windowsforms/matching-game/net5-windows/vb/MatchingGame.Logic/Game.vb rename to windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/Game.vb index 3983c9d89d2..3bf0d14dab2 100644 --- a/windowsforms/matching-game/net5-windows/vb/MatchingGame.Logic/Game.vb +++ b/windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/Game.vb @@ -27,7 +27,7 @@ Public NotInheritable Class Game "b"c, "b"c, "v"c, "v"c, "w"c, "w"c, "z"c, "z"c } - Dim Random As New Random() + Dim random As New Random() For i = 0 To numberOfPairs * 2 - 1 Dim cardIndex = random.Next(availableCards.Count - 1) @@ -59,7 +59,7 @@ Public NotInheritable Class Game Public Function OpenCard(w As Integer, h As Integer) As Integer If _turnCards.Count > 1 Then - Throw New InvalidOperationException("Cannot open more than two cards.") + Throw New InvalidOperationException("Cannot open more than two cards") End If Dim cardIndex = GetIndex(w, h) diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame.Logic/GameSettings.vb b/windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/GameSettings.vb similarity index 100% rename from windowsforms/matching-game/net5-windows/vb/MatchingGame.Logic/GameSettings.vb rename to windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/GameSettings.vb diff --git a/windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/MatchingGame.Logic.vbproj b/windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/MatchingGame.Logic.vbproj new file mode 100644 index 00000000000..a6c14613b52 --- /dev/null +++ b/windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/MatchingGame.Logic.vbproj @@ -0,0 +1,62 @@ + + + net8.0-windows + Library + WindowsForms + true + false + MatchingGame.Logic + MatchingGame.Logic + Copyright © 2020 + 1.0.0.0 + 1.0.0.0 + + + MatchingGame.Logic.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + false + MatchingGame.Logic.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + True + Application.myapp + True + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + \ No newline at end of file diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame.Logic/My Project/Application.Designer.vb b/windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/My Project/Application.Designer.vb similarity index 100% rename from windowsforms/matching-game/net5-windows/vb/MatchingGame.Logic/My Project/Application.Designer.vb rename to windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/My Project/Application.Designer.vb diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame.Logic/My Project/Application.myapp b/windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/My Project/Application.myapp similarity index 100% rename from windowsforms/matching-game/net5-windows/vb/MatchingGame.Logic/My Project/Application.myapp rename to windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/My Project/Application.myapp diff --git a/windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/My Project/AssemblyInfo.vb b/windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/My Project/AssemblyInfo.vb new file mode 100644 index 00000000000..e70c83bea6e --- /dev/null +++ b/windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/My Project/AssemblyInfo.vb @@ -0,0 +1,9 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + + + + +'The following GUID is for the ID of the typelib if this project is exposed to COM + diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame.Logic/My Project/Resources.Designer.vb b/windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/My Project/Resources.Designer.vb similarity index 100% rename from windowsforms/matching-game/net5-windows/vb/MatchingGame.Logic/My Project/Resources.Designer.vb rename to windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/My Project/Resources.Designer.vb diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame/My Project/Resources.resx b/windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/My Project/Resources.resx similarity index 100% rename from windowsforms/matching-game/net5-windows/vb/MatchingGame/My Project/Resources.resx rename to windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/My Project/Resources.resx diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame.Logic/My Project/Settings.Designer.vb b/windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/My Project/Settings.Designer.vb similarity index 100% rename from windowsforms/matching-game/net5-windows/vb/MatchingGame.Logic/My Project/Settings.Designer.vb rename to windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/My Project/Settings.Designer.vb diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame.Logic/My Project/Settings.settings b/windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/My Project/Settings.settings similarity index 100% rename from windowsforms/matching-game/net5-windows/vb/MatchingGame.Logic/My Project/Settings.settings rename to windowsforms/matching-game/net8-windows/vb/MatchingGame.Logic/My Project/Settings.settings diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame.sln b/windowsforms/matching-game/net8-windows/vb/MatchingGame.sln similarity index 100% rename from windowsforms/matching-game/net5-windows/vb/MatchingGame.sln rename to windowsforms/matching-game/net8-windows/vb/MatchingGame.sln diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame/MainForm.Designer.vb b/windowsforms/matching-game/net8-windows/vb/MatchingGame/MainForm.Designer.vb similarity index 100% rename from windowsforms/matching-game/net5-windows/vb/MatchingGame/MainForm.Designer.vb rename to windowsforms/matching-game/net8-windows/vb/MatchingGame/MainForm.Designer.vb diff --git a/windowsforms/matching-game/net5-windows/cs/MatchingGame/MainForm.resx b/windowsforms/matching-game/net8-windows/vb/MatchingGame/MainForm.resx similarity index 97% rename from windowsforms/matching-game/net5-windows/cs/MatchingGame/MainForm.resx rename to windowsforms/matching-game/net8-windows/vb/MatchingGame/MainForm.resx index 1f666f268bc..0d4246b0e77 100644 --- a/windowsforms/matching-game/net5-windows/cs/MatchingGame/MainForm.resx +++ b/windowsforms/matching-game/net8-windows/vb/MatchingGame/MainForm.resx @@ -117,7 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 17, 17 \ No newline at end of file diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame/MainForm.vb b/windowsforms/matching-game/net8-windows/vb/MatchingGame/MainForm.vb similarity index 91% rename from windowsforms/matching-game/net5-windows/vb/MatchingGame/MainForm.vb rename to windowsforms/matching-game/net8-windows/vb/MatchingGame/MainForm.vb index 4048f102582..e518674c570 100644 --- a/windowsforms/matching-game/net5-windows/vb/MatchingGame/MainForm.vb +++ b/windowsforms/matching-game/net8-windows/vb/MatchingGame/MainForm.vb @@ -29,7 +29,7 @@ Public Class MainForm Next End Sub - Private Sub label_Click(sender As Object, e As EventArgs) Handles label1.Click, label2.Click, label3.Click, label4.Click, label5.Click, label6.Click, label7.Click, label8.Click, label9.Click, label10.Click, label11.Click, label12.Click, label13.Click, label14.Click, label15.Click, label16.Click + Private Sub label_Click(sender As Object, e As EventArgs) Handles label16.Click, label15.Click, label9.Click, label8.Click, label7.Click, label6.Click, label5.Click, label4.Click, label3.Click, label2.Click, label14.Click, label13.Click, label12.Click, label11.Click, label10.Click, label1.Click If closeCardTimer.Enabled Then Return If TypeOf sender Is Label Then diff --git a/windowsforms/matching-game/net8-windows/vb/MatchingGame/MatchingGame.vbproj b/windowsforms/matching-game/net8-windows/vb/MatchingGame/MatchingGame.vbproj new file mode 100644 index 00000000000..1625abbb078 --- /dev/null +++ b/windowsforms/matching-game/net8-windows/vb/MatchingGame/MatchingGame.vbproj @@ -0,0 +1,59 @@ + + + net8.0-windows + WinExe + MatchingGame.My.MyApplication + WindowsForms + false + true + true + MatchingGame + MatchingGame + Copyright © 2020 + 1.0.0.0 + 1.0.0.0 + + + MatchingGame.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + false + MatchingGame.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + + + + + + + + + \ No newline at end of file diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame/My Project/Application.Designer.vb b/windowsforms/matching-game/net8-windows/vb/MatchingGame/My Project/Application.Designer.vb similarity index 100% rename from windowsforms/matching-game/net5-windows/vb/MatchingGame/My Project/Application.Designer.vb rename to windowsforms/matching-game/net8-windows/vb/MatchingGame/My Project/Application.Designer.vb diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame/My Project/Application.myapp b/windowsforms/matching-game/net8-windows/vb/MatchingGame/My Project/Application.myapp similarity index 100% rename from windowsforms/matching-game/net5-windows/vb/MatchingGame/My Project/Application.myapp rename to windowsforms/matching-game/net8-windows/vb/MatchingGame/My Project/Application.myapp diff --git a/windowsforms/matching-game/net8-windows/vb/MatchingGame/My Project/AssemblyInfo.vb b/windowsforms/matching-game/net8-windows/vb/MatchingGame/My Project/AssemblyInfo.vb new file mode 100644 index 00000000000..88213df1acc --- /dev/null +++ b/windowsforms/matching-game/net8-windows/vb/MatchingGame/My Project/AssemblyInfo.vb @@ -0,0 +1,9 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + + + + +'The following GUID is for the ID of the typelib if this project is exposed to COM + diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame/My Project/Resources.Designer.vb b/windowsforms/matching-game/net8-windows/vb/MatchingGame/My Project/Resources.Designer.vb similarity index 100% rename from windowsforms/matching-game/net5-windows/vb/MatchingGame/My Project/Resources.Designer.vb rename to windowsforms/matching-game/net8-windows/vb/MatchingGame/My Project/Resources.Designer.vb diff --git a/windowsforms/matching-game/net5-windows/cs/MatchingGame/Properties/Resources.resx b/windowsforms/matching-game/net8-windows/vb/MatchingGame/My Project/Resources.resx similarity index 88% rename from windowsforms/matching-game/net5-windows/cs/MatchingGame/Properties/Resources.resx rename to windowsforms/matching-game/net8-windows/vb/MatchingGame/My Project/Resources.resx index 0cab21c44ce..af7dbebbace 100644 --- a/windowsforms/matching-game/net5-windows/cs/MatchingGame/Properties/Resources.resx +++ b/windowsforms/matching-game/net8-windows/vb/MatchingGame/My Project/Resources.resx @@ -46,7 +46,7 @@ mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : System.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 @@ -60,7 +60,6 @@ : and then encoded with base64 encoding. --> - @@ -69,10 +68,9 @@ - + - @@ -87,10 +85,9 @@ - + - @@ -112,13 +109,9 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - a - s - \ No newline at end of file diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame/My Project/Settings.Designer.vb b/windowsforms/matching-game/net8-windows/vb/MatchingGame/My Project/Settings.Designer.vb similarity index 100% rename from windowsforms/matching-game/net5-windows/vb/MatchingGame/My Project/Settings.Designer.vb rename to windowsforms/matching-game/net8-windows/vb/MatchingGame/My Project/Settings.Designer.vb diff --git a/windowsforms/matching-game/net5-windows/vb/MatchingGame/My Project/Settings.settings b/windowsforms/matching-game/net8-windows/vb/MatchingGame/My Project/Settings.settings similarity index 100% rename from windowsforms/matching-game/net5-windows/vb/MatchingGame/My Project/Settings.settings rename to windowsforms/matching-game/net8-windows/vb/MatchingGame/My Project/Settings.settings diff --git a/windowsforms/matching-game/net8-windows/vb/readme.md b/windowsforms/matching-game/net8-windows/vb/readme.md new file mode 100644 index 00000000000..79a82194c87 --- /dev/null +++ b/windowsforms/matching-game/net8-windows/vb/readme.md @@ -0,0 +1,21 @@ +--- +languages: +- vb +products: +- dotnet +- dotnet-core +- windows-forms +page_type: sample +name: "Matching Game Sample (.NET 8 Visual Basic)" +urlFragment: "matching-game-net-vb" +description: "A simple matching game" +--- +# Matching game + +This sample demonstrates a simple memory game where you try to match tiles in the fewest amount of moves possible. This sample was migrated from the [.NET Framework version](https://github.com/dotnet/samples/tree/main/windowsforms/matching-game/net45/vb). + +## Prerequisites + +- [Visual Studio 2022 version 17.8](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=learn.microsoft.com&utm_campaign=inline+link&utm_content=download+vs2022+desktopguide+winforms+migration) + + - Enable the [Visual Studio Desktop workload](https://learn.microsoft.com/visualstudio/install/modify-visual-studio?view=vs-2022&preserve-view=true#modify-workloads).