Skip to content

Commit 788daf1

Browse files
committed
Upgrade demos
1 parent 3d36867 commit 788daf1

File tree

18 files changed

+33
-27
lines changed

18 files changed

+33
-27
lines changed

Diff for: .github/workflows/demos.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on: [push, pull_request]
44

55
env:
66
Configuration: Release
7-
ContinuousIntegrationBuild: true
87
DOTNET_CLI_TELEMETRY_OPTOUT: true
98
DOTNET_NOLOGO: true
109

@@ -20,7 +19,7 @@ jobs:
2019
- name: Setup .NET SDK
2120
uses: actions/setup-dotnet@v4
2221
with:
23-
dotnet-version: 6.0.x
22+
dotnet-version: 8.0.x
2423
- name: Create local NuGet source
2524
run: |
2625
mkdir ..\LocalPackages

Diff for: Demo-ASP.NET-Core/Demo-ASP.NET-Core.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net5.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<RootNamespace>Net.Codecrete.QrCodeGenerator.Demo</RootNamespace>
66
</PropertyGroup>
77

Diff for: Demo-ImageMagick/Demo-ImageMagick.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<RootNamespace>Net.Codecrete.QrCodeGenerator.Demo</RootNamespace>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>

Diff for: Demo-ImageSharp/Demo-ImageSharp.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<RootNamespace>Net.Codecrete.QrCodeGenerator.Demo</RootNamespace>
77
<PackageId>Net.Codecrete.QrCodeGenerator.Demo</PackageId>
88
<Version>2.0.6</Version>

Diff for: Demo-QRCode-Variety/Demo-QRCode-Variety.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net5.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<RootNamespace>Demo_Basic</RootNamespace>
77
</PropertyGroup>
88

Diff for: Demo-SkiaSharp/Demo-SkiaSharp.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<RootNamespace>Net.Codecrete.QrCodeGenerator.Demo</RootNamespace>
77
<PackageId>Net.Codecrete.QrCodeGenerator.Demo</PackageId>
88
<Version>2.0.6</Version>

Diff for: Demo-System-Drawing/Demo-System-Drawing.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<RootNamespace>Net.Codecrete.QrCodeGenerator.Demo</RootNamespace>
77
<PackageId>Net.Codecrete.QrCodeGenerator.Demo</PackageId>
88
<Version>2.0.6</Version>

Diff for: Demo-System-Drawing/QrCodeBitmapExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public static void Draw(this QrCode qrCode, Graphics graphics, float scale, floa
121121
float dim = (size + border * 2) * scale;
122122

123123
// draw background
124-
if (background != null)
124+
if (background != Color.Transparent)
125125
{
126126
using SolidBrush brush = new SolidBrush(background);
127127
graphics.FillRectangle(brush, 0, 0, dim, dim);

Diff for: Demo-VCard/VCardDemo.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>

Diff for: Demo-WinForms/Demo-WinForms.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net8.0-windows</TargetFramework>
66
<RootNamespace>Net.Codecrete.QrCodeGenerator.Demo</RootNamespace>
7-
<UseWindowsForms>true</UseWindowsForms>
7+
<UseWindowsForms>True</UseWindowsForms>
88
</PropertyGroup>
99

1010
<ItemGroup>

Diff for: Demo-WinForms/QrCodeBitmapExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public static void Draw(this QrCode qrCode, Graphics graphics, float scale, floa
121121
float dim = (size + border * 2) * scale;
122122

123123
// draw background
124-
if (background != null)
124+
if (background != Color.Transparent)
125125
{
126126
using SolidBrush brush = new SolidBrush(background);
127127
graphics.FillRectangle(brush, 0, 0, dim, dim);

Diff for: Demo-WinUI/Demo-WinUI/App.xaml.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
using System.Runtime.InteropServices;
1313
using Windows.Graphics;
1414
using WinRT.Interop;
15+
using Windows.Win32;
16+
using Windows.Win32.Foundation;
1517

1618
namespace Net.Codecrete.QrCodeGenerator.Demo;
1719

@@ -63,7 +65,8 @@ private AppWindow GetAppWindow()
6365

6466
private double GetDpiScalingFactor()
6567
{
66-
var dpi = PInvoke.User32.GetDpiForWindow(WindowNative.GetWindowHandle(m_window));
68+
IntPtr hWnd = WindowNative.GetWindowHandle(m_window);
69+
var dpi = PInvoke.GetDpiForWindow((HWND)hWnd);
6770
return (float)dpi / 96;
6871
}
6972
}

Diff for: Demo-WinUI/Demo-WinUI/Demo-WinUI.csproj

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>WinExe</OutputType>
4-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
4+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
55
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
66
<RootNamespace>Net.Codecrete.QrCodeGenerator.Demo</RootNamespace>
77
<ApplicationManifest>app.manifest</ApplicationManifest>
88
<Platforms>x86;x64;ARM64</Platforms>
9-
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
10-
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
9+
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
10+
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
1111
<UseWinUI>true</UseWinUI>
1212
<EnableMsixTooling>true</EnableMsixTooling>
1313
<AssemblyName>QrCodeWinUIDemo</AssemblyName>
@@ -33,12 +33,15 @@
3333
</ItemGroup>
3434

3535
<ItemGroup>
36-
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.0.0" />
37-
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.0.4" />
38-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221116.1" />
39-
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
36+
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
37+
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.3.0" />
38+
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.106">
39+
<PrivateAssets>all</PrivateAssets>
40+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
41+
</PackageReference>
42+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.241114003" />
43+
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
4044
<PackageReference Include="Net.Codecrete.QrCodeGenerator" Version="2.0.6" />
41-
<PackageReference Include="PInvoke.User32" Version="0.7.124" />
4245
<Manifest Include="$(ApplicationManifest)" />
4346
</ItemGroup>
4447

Diff for: Demo-WinUI/Demo-WinUI/NativeMethods.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
GetDpiForWindow

Diff for: Demo-WinUI/Demo-WinUI/Properties/PublishProfiles/win10-arm64.pubxml renamed to Demo-WinUI/Demo-WinUI/Properties/PublishProfiles/win-arm64.pubxml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
66
<PropertyGroup>
77
<PublishProtocol>FileSystem</PublishProtocol>
88
<Platform>ARM64</Platform>
9-
<RuntimeIdentifier>win10-arm64</RuntimeIdentifier>
9+
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
1010
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
1111
<SelfContained>true</SelfContained>
1212
<PublishSingleFile>False</PublishSingleFile>

Diff for: Demo-WinUI/Demo-WinUI/Properties/PublishProfiles/win10-x64.pubxml renamed to Demo-WinUI/Demo-WinUI/Properties/PublishProfiles/win-x64.pubxml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
66
<PropertyGroup>
77
<PublishProtocol>FileSystem</PublishProtocol>
88
<Platform>x64</Platform>
9-
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
9+
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
1010
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
1111
<SelfContained>true</SelfContained>
1212
<PublishSingleFile>False</PublishSingleFile>

Diff for: Demo-WinUI/Demo-WinUI/Properties/PublishProfiles/win10-x86.pubxml renamed to Demo-WinUI/Demo-WinUI/Properties/PublishProfiles/win-x86.pubxml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
66
<PropertyGroup>
77
<PublishProtocol>FileSystem</PublishProtocol>
88
<Platform>x86</Platform>
9-
<RuntimeIdentifier>win10-x86</RuntimeIdentifier>
9+
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
1010
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
1111
<SelfContained>true</SelfContained>
1212
<PublishSingleFile>False</PublishSingleFile>

Diff for: Demo-WindowsPresentationFoundation/Demo-WindowsPresentationFoundation.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFramework>net5.0-windows</TargetFramework>
5+
<TargetFramework>net8.0-windows</TargetFramework>
66
<RootNamespace>Net.Codecrete.QrCodeGenerator.Demo</RootNamespace>
77
<Nullable>enable</Nullable>
88
<UseWPF>true</UseWPF>

0 commit comments

Comments
 (0)