Add project files and configuration for .NET 9.0 Windows Desktop

This commit is contained in:
vista-man
2025-01-27 20:02:36 +01:00
parent 5e0e0a7907
commit 20e9e8b457
28 changed files with 444 additions and 0 deletions

View File

View File

@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net9.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
</Project>

132
Csharp/Gokspel/Program.cs Normal file
View File

@@ -0,0 +1,132 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Collections.Generic;
class Program : Form
{
private Random random = new Random();
private int numberToGuess;
private TextBox inputBox;
private Label resultLabel;
private Button guessButton;
private System.Windows.Forms.Timer confettiTimer;
private List<Confetti> confettiList = new List<Confetti>();
public Program()
{
numberToGuess = random.Next(1, 101);
this.Text = "Gokspel";
this.Size = new System.Drawing.Size(300, 200);
Label promptLabel = new Label();
promptLabel.Text = "Raad het getal tussen 1 en 100:";
promptLabel.Location = new System.Drawing.Point(10, 20);
promptLabel.AutoSize = true;
this.Controls.Add(promptLabel);
inputBox = new TextBox();
inputBox.Location = new System.Drawing.Point(10, 50);
this.Controls.Add(inputBox);
guessButton = new Button();
guessButton.Text = "Gok";
guessButton.Location = new System.Drawing.Point(10, 80);
guessButton.Click += new EventHandler(GuessButton_Click);
this.Controls.Add(guessButton);
resultLabel = new Label();
resultLabel.Location = new System.Drawing.Point(10, 110);
resultLabel.AutoSize = true;
this.Controls.Add(resultLabel);
confettiTimer = new System.Windows.Forms.Timer();
confettiTimer.Interval = 30;
confettiTimer.Tick += new EventHandler(ConfettiTimer_Tick);
}
private void GuessButton_Click(object sender, EventArgs e)
{
int userGuess;
if (int.TryParse(inputBox.Text, out userGuess))
{
if (userGuess < numberToGuess)
{
resultLabel.Text = "Te laag! Probeer opnieuw.";
}
else if (userGuess > numberToGuess)
{
resultLabel.Text = "Te hoog! Probeer opnieuw.";
}
else
{
resultLabel.Text = "Gefeliciteerd! Je hebt het juiste getal geraden.";
StartConfetti();
}
}
else
{
resultLabel.Text = "Ongeldige invoer. Voer een getal in.";
}
}
private void StartConfetti()
{
confettiList.Clear();
for (int i = 0; i < 100; i++)
{
confettiList.Add(new Confetti(random, this.ClientSize));
}
confettiTimer.Start();
}
private void ConfettiTimer_Tick(object sender, EventArgs e)
{
for (int i = 0; i < confettiList.Count; i++)
{
confettiList[i].Update();
}
this.Invalidate();
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
foreach (var confetti in confettiList)
{
e.Graphics.FillEllipse(new SolidBrush(confetti.Color), confetti.Position.X, confetti.Position.Y, confetti.Size, confetti.Size);
}
}
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.Run(new Program());
}
}
class Confetti
{
public PointF Position;
public float SpeedY;
public float SpeedX;
public float Size;
public Color Color;
public Confetti(Random random, Size clientSize)
{
Position = new PointF(random.Next(clientSize.Width), random.Next(clientSize.Height));
SpeedY = (float)(random.NextDouble() * 2 + 1);
SpeedX = (float)(random.NextDouble() * 2 - 1);
Size = random.Next(5, 10);
Color = Color.FromArgb(random.Next(256), random.Next(256), random.Next(256));
}
public void Update()
{
Position = new PointF(Position.X + SpeedX, Position.Y + SpeedY);
SpeedY += 0.1f; // gravity effect
}
}

View File

@@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v9.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v9.0": {
"Gokspel/1.0.0": {
"runtime": {
"Gokspel.dll": {}
}
}
}
},
"libraries": {
"Gokspel/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,19 @@
{
"runtimeOptions": {
"tfm": "net9.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "9.0.0"
},
{
"name": "Microsoft.WindowsDesktop.App",
"version": "9.0.0"
}
],
"configProperties": {
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false,
"CSWINRT_USE_WINDOWS_UI_XAML_PROJECTIONS": false
}
}
}

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")]

View File

@@ -0,0 +1,24 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Gokspel")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5e0e0a7907fee55389f89acc2c73bf9b341ddcaa")]
[assembly: System.Reflection.AssemblyProductAttribute("Gokspel")]
[assembly: System.Reflection.AssemblyTitleAttribute("Gokspel")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
[assembly: System.Runtime.Versioning.TargetPlatformAttribute("Windows7.0")]
[assembly: System.Runtime.Versioning.SupportedOSPlatformAttribute("Windows7.0")]
// Generated by the MSBuild WriteCodeFragment class.

View File

@@ -0,0 +1 @@
c9244a4ee0444c03cc63d0bf7d904d54d44cbc174ca7623827c8d17875284eed

View File

@@ -0,0 +1,22 @@
is_global = true
build_property.ApplicationManifest =
build_property.StartupObject =
build_property.ApplicationDefaultFont =
build_property.ApplicationHighDpiMode =
build_property.ApplicationUseCompatibleTextRendering =
build_property.ApplicationVisualStyles =
build_property.TargetFramework = net9.0-windows
build_property.TargetPlatformMinVersion = 7.0
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Gokspel
build_property.ProjectDir = C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Gokspel\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.CsWinRTUseWindowsUIXamlProjections = false
build_property.EffectiveAnalysisLevelStyle = 9.0
build_property.EnableCodeStyleSeverity =

View File

@@ -0,0 +1,10 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.Drawing;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;
global using global::System.Windows.Forms;

View File

@@ -0,0 +1 @@
6258808813e5da8787aa8a4db673cfdb5207a4e1e95c3f4ea4bd9981576d142d

View File

@@ -0,0 +1,15 @@
C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Gokspel\bin\Debug\net9.0-windows\Gokspel.exe
C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Gokspel\bin\Debug\net9.0-windows\Gokspel.deps.json
C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Gokspel\bin\Debug\net9.0-windows\Gokspel.runtimeconfig.json
C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Gokspel\bin\Debug\net9.0-windows\Gokspel.dll
C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Gokspel\bin\Debug\net9.0-windows\Gokspel.pdb
C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Gokspel\obj\Debug\net9.0-windows\Gokspel.GeneratedMSBuildEditorConfig.editorconfig
C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Gokspel\obj\Debug\net9.0-windows\Gokspel.AssemblyInfoInputs.cache
C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Gokspel\obj\Debug\net9.0-windows\Gokspel.AssemblyInfo.cs
C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Gokspel\obj\Debug\net9.0-windows\Gokspel.csproj.CoreCompileInputs.cache
C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Gokspel\obj\Debug\net9.0-windows\Gokspel.sourcelink.json
C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Gokspel\obj\Debug\net9.0-windows\Gokspel.dll
C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Gokspel\obj\Debug\net9.0-windows\refint\Gokspel.dll
C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Gokspel\obj\Debug\net9.0-windows\Gokspel.pdb
C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Gokspel\obj\Debug\net9.0-windows\Gokspel.genruntimeconfig.cache
C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Gokspel\obj\Debug\net9.0-windows\ref\Gokspel.dll

Binary file not shown.

View File

@@ -0,0 +1 @@
cd6e305ea58b32f5fb6ebb6b6a9ec74b86ff1df683d887884c62b90a98adbdf8

Binary file not shown.

View File

@@ -0,0 +1 @@
{"documents":{"C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\*":"https://raw.githubusercontent.com/Alvin-Zilverstand/ict-algemeen-opdrachten/5e0e0a7907fee55389f89acc2c73bf9b341ddcaa/*"}}

Binary file not shown.

View File

@@ -0,0 +1,74 @@
{
"format": 1,
"restore": {
"C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\Csharp\\Gokspel\\Gokspel.csproj": {}
},
"projects": {
"C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\Csharp\\Gokspel\\Gokspel.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\Csharp\\Gokspel\\Gokspel.csproj",
"projectName": "Gokspel",
"projectPath": "C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\Csharp\\Gokspel\\Gokspel.csproj",
"packagesPath": "C:\\Users\\steen\\.nuget\\packages\\",
"outputPath": "C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\Csharp\\Gokspel\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\steen\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config"
],
"originalTargetFrameworks": [
"net9.0-windows"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net9.0-windows7.0": {
"targetAlias": "net9.0-windows",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "9.0.100"
},
"frameworks": {
"net9.0-windows7.0": {
"targetAlias": "net9.0-windows",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
},
"Microsoft.WindowsDesktop.App.WindowsForms": {
"privateAssets": "none"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.102/PortableRuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\steen\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.12.2</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\steen\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

View File

@@ -0,0 +1,80 @@
{
"version": 3,
"targets": {
"net9.0-windows7.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net9.0-windows7.0": []
},
"packageFolders": {
"C:\\Users\\steen\\.nuget\\packages\\": {},
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\Csharp\\Gokspel\\Gokspel.csproj",
"projectName": "Gokspel",
"projectPath": "C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\Csharp\\Gokspel\\Gokspel.csproj",
"packagesPath": "C:\\Users\\steen\\.nuget\\packages\\",
"outputPath": "C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\Csharp\\Gokspel\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\steen\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config"
],
"originalTargetFrameworks": [
"net9.0-windows"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net9.0-windows7.0": {
"targetAlias": "net9.0-windows",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "9.0.100"
},
"frameworks": {
"net9.0-windows7.0": {
"targetAlias": "net9.0-windows",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
},
"Microsoft.WindowsDesktop.App.WindowsForms": {
"privateAssets": "none"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.102/PortableRuntimeIdentifierGraph.json"
}
}
}
}

View File

@@ -0,0 +1,8 @@
{
"version": 2,
"dgSpecHash": "ZJuznUkDFiQ=",
"success": true,
"projectFilePath": "C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\Csharp\\Gokspel\\Gokspel.csproj",
"expectedPackageFiles": [],
"logs": []
}