diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml
index c14974c..b15894b 100644
--- a/.github/workflows/dotnet.yml
+++ b/.github/workflows/dotnet.yml
@@ -13,6 +13,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
+
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: '9.0.x'
- name: Install workloads
run: dotnet workload install maui
diff --git a/H.NotifyIcon.sln b/H.NotifyIcon.sln
deleted file mode 100644
index c969697..0000000
--- a/H.NotifyIcon.sln
+++ /dev/null
@@ -1,376 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.1.32120.378
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "H.NotifyIcon.Wpf", "src\libs\H.NotifyIcon.Wpf\H.NotifyIcon.Wpf.csproj", "{7AC63864-7638-41C4-969C-D3197EF2BED9}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libs", "libs", "{FCF55611-6E25-4F1E-8E88-705896171E71}"
- ProjectSection(SolutionItems) = preProject
- src\libs\Directory.Build.props = src\libs\Directory.Build.props
- src\libs\Directory.Build.targets = src\libs\Directory.Build.targets
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{90AF73FD-213A-4054-B99B-58E1864D7142}"
- ProjectSection(SolutionItems) = preProject
- .gitignore = .gitignore
- .github\ISSUE_TEMPLATE\bug-report.yaml = .github\ISSUE_TEMPLATE\bug-report.yaml
- src\Directory.Build.props = src\Directory.Build.props
- .github\workflows\dotnet.yml = .github\workflows\dotnet.yml
- LICENSE.md = LICENSE.md
- .github\workflows\pr.yml = .github\workflows\pr.yml
- README.md = README.md
- .github\workflows\auto-merge.yml = .github\workflows\auto-merge.yml
- EndProjectSection
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "H.NotifyIcon", "src\libs\H.NotifyIcon\H.NotifyIcon.csproj", "{0485EE3E-3745-4E79-A396-19AE493FA9D3}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "H.NotifyIcon.WinUI", "src\libs\H.NotifyIcon.WinUI\H.NotifyIcon.WinUI.csproj", "{2C93516E-87C6-4212-8A85-95D85AB23098}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "apps", "apps", "{52FA15AF-CAE7-4822-9975-F5E812EDEF33}"
- ProjectSection(SolutionItems) = preProject
- src\apps\Directory.Build.props = src\apps\Directory.Build.props
- EndProjectSection
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "H.NotifyIcon.Apps.WinUI", "src\apps\H.NotifyIcon.Apps.WinUI\H.NotifyIcon.Apps.WinUI.csproj", "{665598EE-10CA-4842-B169-F5A6EF483C7F}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "H.NotifyIcon.Uno", "src\libs\H.NotifyIcon.Uno\H.NotifyIcon.Uno.csproj", "{85B419CD-F64D-459E-A287-2C4775E75FD6}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "H.NotifyIcon.Uno.WinUI", "src\libs\H.NotifyIcon.Uno.WinUI\H.NotifyIcon.Uno.WinUI.csproj", "{81360AA9-0DD6-4A49-8D6E-05AD3160391E}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{40478FA5-043C-415E-984B-2DBACCBB97A6}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "H.NotifyIcon.IntegrationTests", "src\tests\H.NotifyIcon.IntegrationTests\H.NotifyIcon.IntegrationTests.csproj", "{EE945F20-366B-4273-878F-F8969992B8CC}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "H.NotifyIcon.Apps.Console", "src\apps\H.NotifyIcon.Apps.Console\H.NotifyIcon.Apps.Console.csproj", "{DC947B8B-E363-4104-A38A-0C3D08047D82}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "H.NotifyIcon.Apps.Wpf", "src\apps\H.NotifyIcon.Apps.Wpf\H.NotifyIcon.Apps.Wpf.csproj", "{B95580F0-895E-499B-BBE6-78258069DE02}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "H.NotifyIcon.Apps.Wpf.Windowless", "src\apps\H.NotifyIcon.Apps.Wpf.Windowless\H.NotifyIcon.Apps.Wpf.Windowless.csproj", "{50653194-B56C-4270-85FD-9FF0A2C331AD}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "H.NotifyIcon.Apps.WinUI.Windowless", "src\apps\H.NotifyIcon.Apps.WinUI.Windowless\H.NotifyIcon.Apps.WinUI.Windowless.csproj", "{73850D1A-5384-49EC-8115-6FA27E6423D0}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TrimmingHelper", "src\apps\TrimmingHelper\TrimmingHelper.csproj", "{A04E983D-5631-4C68-B34A-796970E060C0}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "H.GeneratedIcons.System.Drawing", "src\libs\H.GeneratedIcons.System.Drawing\H.GeneratedIcons.System.Drawing.csproj", "{A4A97F4E-71C1-42FA-84DC-7D4A41079A13}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "H.GeneratedIcons.SkiaSharp", "src\libs\H.GeneratedIcons.SkiaSharp\H.GeneratedIcons.SkiaSharp.csproj", "{EECF393D-0F55-4BFE-AEA8-7FD90383C05D}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "H.NotifyIcon.Maui", "src\libs\H.NotifyIcon.Maui\H.NotifyIcon.Maui.csproj", "{84E993AA-5343-4502-9612-B9A416AF243F}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "H.NotifyIcon.Apps.Maui", "src\apps\H.NotifyIcon.Apps.Maui\H.NotifyIcon.Apps.Maui.csproj", "{6C5EA367-5663-420E-B10C-8E5543EBF8DD}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Debug|arm64 = Debug|arm64
- Debug|x64 = Debug|x64
- Debug|x86 = Debug|x86
- Release|Any CPU = Release|Any CPU
- Release|arm64 = Release|arm64
- Release|x64 = Release|x64
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {7AC63864-7638-41C4-969C-D3197EF2BED9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7AC63864-7638-41C4-969C-D3197EF2BED9}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7AC63864-7638-41C4-969C-D3197EF2BED9}.Debug|arm64.ActiveCfg = Debug|Any CPU
- {7AC63864-7638-41C4-969C-D3197EF2BED9}.Debug|arm64.Build.0 = Debug|Any CPU
- {7AC63864-7638-41C4-969C-D3197EF2BED9}.Debug|x64.ActiveCfg = Debug|Any CPU
- {7AC63864-7638-41C4-969C-D3197EF2BED9}.Debug|x64.Build.0 = Debug|Any CPU
- {7AC63864-7638-41C4-969C-D3197EF2BED9}.Debug|x86.ActiveCfg = Debug|Any CPU
- {7AC63864-7638-41C4-969C-D3197EF2BED9}.Debug|x86.Build.0 = Debug|Any CPU
- {7AC63864-7638-41C4-969C-D3197EF2BED9}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7AC63864-7638-41C4-969C-D3197EF2BED9}.Release|Any CPU.Build.0 = Release|Any CPU
- {7AC63864-7638-41C4-969C-D3197EF2BED9}.Release|arm64.ActiveCfg = Release|Any CPU
- {7AC63864-7638-41C4-969C-D3197EF2BED9}.Release|arm64.Build.0 = Release|Any CPU
- {7AC63864-7638-41C4-969C-D3197EF2BED9}.Release|x64.ActiveCfg = Release|Any CPU
- {7AC63864-7638-41C4-969C-D3197EF2BED9}.Release|x64.Build.0 = Release|Any CPU
- {7AC63864-7638-41C4-969C-D3197EF2BED9}.Release|x86.ActiveCfg = Release|Any CPU
- {7AC63864-7638-41C4-969C-D3197EF2BED9}.Release|x86.Build.0 = Release|Any CPU
- {0485EE3E-3745-4E79-A396-19AE493FA9D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0485EE3E-3745-4E79-A396-19AE493FA9D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0485EE3E-3745-4E79-A396-19AE493FA9D3}.Debug|arm64.ActiveCfg = Debug|Any CPU
- {0485EE3E-3745-4E79-A396-19AE493FA9D3}.Debug|arm64.Build.0 = Debug|Any CPU
- {0485EE3E-3745-4E79-A396-19AE493FA9D3}.Debug|x64.ActiveCfg = Debug|Any CPU
- {0485EE3E-3745-4E79-A396-19AE493FA9D3}.Debug|x64.Build.0 = Debug|Any CPU
- {0485EE3E-3745-4E79-A396-19AE493FA9D3}.Debug|x86.ActiveCfg = Debug|Any CPU
- {0485EE3E-3745-4E79-A396-19AE493FA9D3}.Debug|x86.Build.0 = Debug|Any CPU
- {0485EE3E-3745-4E79-A396-19AE493FA9D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0485EE3E-3745-4E79-A396-19AE493FA9D3}.Release|Any CPU.Build.0 = Release|Any CPU
- {0485EE3E-3745-4E79-A396-19AE493FA9D3}.Release|arm64.ActiveCfg = Release|Any CPU
- {0485EE3E-3745-4E79-A396-19AE493FA9D3}.Release|arm64.Build.0 = Release|Any CPU
- {0485EE3E-3745-4E79-A396-19AE493FA9D3}.Release|x64.ActiveCfg = Release|Any CPU
- {0485EE3E-3745-4E79-A396-19AE493FA9D3}.Release|x64.Build.0 = Release|Any CPU
- {0485EE3E-3745-4E79-A396-19AE493FA9D3}.Release|x86.ActiveCfg = Release|Any CPU
- {0485EE3E-3745-4E79-A396-19AE493FA9D3}.Release|x86.Build.0 = Release|Any CPU
- {2C93516E-87C6-4212-8A85-95D85AB23098}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {2C93516E-87C6-4212-8A85-95D85AB23098}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {2C93516E-87C6-4212-8A85-95D85AB23098}.Debug|arm64.ActiveCfg = Debug|Any CPU
- {2C93516E-87C6-4212-8A85-95D85AB23098}.Debug|arm64.Build.0 = Debug|Any CPU
- {2C93516E-87C6-4212-8A85-95D85AB23098}.Debug|x64.ActiveCfg = Debug|Any CPU
- {2C93516E-87C6-4212-8A85-95D85AB23098}.Debug|x64.Build.0 = Debug|Any CPU
- {2C93516E-87C6-4212-8A85-95D85AB23098}.Debug|x86.ActiveCfg = Debug|Any CPU
- {2C93516E-87C6-4212-8A85-95D85AB23098}.Debug|x86.Build.0 = Debug|Any CPU
- {2C93516E-87C6-4212-8A85-95D85AB23098}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {2C93516E-87C6-4212-8A85-95D85AB23098}.Release|Any CPU.Build.0 = Release|Any CPU
- {2C93516E-87C6-4212-8A85-95D85AB23098}.Release|arm64.ActiveCfg = Release|Any CPU
- {2C93516E-87C6-4212-8A85-95D85AB23098}.Release|arm64.Build.0 = Release|Any CPU
- {2C93516E-87C6-4212-8A85-95D85AB23098}.Release|x64.ActiveCfg = Release|Any CPU
- {2C93516E-87C6-4212-8A85-95D85AB23098}.Release|x64.Build.0 = Release|Any CPU
- {2C93516E-87C6-4212-8A85-95D85AB23098}.Release|x86.ActiveCfg = Release|Any CPU
- {2C93516E-87C6-4212-8A85-95D85AB23098}.Release|x86.Build.0 = Release|Any CPU
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Debug|Any CPU.ActiveCfg = Debug|x64
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Debug|Any CPU.Build.0 = Debug|x64
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Debug|Any CPU.Deploy.0 = Debug|x64
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Debug|arm64.ActiveCfg = Debug|arm64
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Debug|arm64.Build.0 = Debug|arm64
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Debug|arm64.Deploy.0 = Debug|arm64
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Debug|x64.ActiveCfg = Debug|x64
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Debug|x64.Build.0 = Debug|x64
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Debug|x64.Deploy.0 = Debug|x64
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Debug|x86.ActiveCfg = Debug|x86
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Debug|x86.Build.0 = Debug|x86
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Debug|x86.Deploy.0 = Debug|x86
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Release|Any CPU.ActiveCfg = Release|x64
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Release|Any CPU.Build.0 = Release|x64
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Release|Any CPU.Deploy.0 = Release|x64
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Release|arm64.ActiveCfg = Release|arm64
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Release|arm64.Build.0 = Release|arm64
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Release|arm64.Deploy.0 = Release|arm64
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Release|x64.ActiveCfg = Release|x64
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Release|x64.Build.0 = Release|x64
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Release|x64.Deploy.0 = Release|x64
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Release|x86.ActiveCfg = Release|x86
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Release|x86.Build.0 = Release|x86
- {665598EE-10CA-4842-B169-F5A6EF483C7F}.Release|x86.Deploy.0 = Release|x86
- {85B419CD-F64D-459E-A287-2C4775E75FD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {85B419CD-F64D-459E-A287-2C4775E75FD6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {85B419CD-F64D-459E-A287-2C4775E75FD6}.Debug|arm64.ActiveCfg = Debug|Any CPU
- {85B419CD-F64D-459E-A287-2C4775E75FD6}.Debug|arm64.Build.0 = Debug|Any CPU
- {85B419CD-F64D-459E-A287-2C4775E75FD6}.Debug|x64.ActiveCfg = Debug|Any CPU
- {85B419CD-F64D-459E-A287-2C4775E75FD6}.Debug|x64.Build.0 = Debug|Any CPU
- {85B419CD-F64D-459E-A287-2C4775E75FD6}.Debug|x86.ActiveCfg = Debug|Any CPU
- {85B419CD-F64D-459E-A287-2C4775E75FD6}.Debug|x86.Build.0 = Debug|Any CPU
- {85B419CD-F64D-459E-A287-2C4775E75FD6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {85B419CD-F64D-459E-A287-2C4775E75FD6}.Release|Any CPU.Build.0 = Release|Any CPU
- {85B419CD-F64D-459E-A287-2C4775E75FD6}.Release|arm64.ActiveCfg = Release|Any CPU
- {85B419CD-F64D-459E-A287-2C4775E75FD6}.Release|arm64.Build.0 = Release|Any CPU
- {85B419CD-F64D-459E-A287-2C4775E75FD6}.Release|x64.ActiveCfg = Release|Any CPU
- {85B419CD-F64D-459E-A287-2C4775E75FD6}.Release|x64.Build.0 = Release|Any CPU
- {85B419CD-F64D-459E-A287-2C4775E75FD6}.Release|x86.ActiveCfg = Release|Any CPU
- {85B419CD-F64D-459E-A287-2C4775E75FD6}.Release|x86.Build.0 = Release|Any CPU
- {81360AA9-0DD6-4A49-8D6E-05AD3160391E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {81360AA9-0DD6-4A49-8D6E-05AD3160391E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {81360AA9-0DD6-4A49-8D6E-05AD3160391E}.Debug|arm64.ActiveCfg = Debug|Any CPU
- {81360AA9-0DD6-4A49-8D6E-05AD3160391E}.Debug|arm64.Build.0 = Debug|Any CPU
- {81360AA9-0DD6-4A49-8D6E-05AD3160391E}.Debug|x64.ActiveCfg = Debug|Any CPU
- {81360AA9-0DD6-4A49-8D6E-05AD3160391E}.Debug|x64.Build.0 = Debug|Any CPU
- {81360AA9-0DD6-4A49-8D6E-05AD3160391E}.Debug|x86.ActiveCfg = Debug|Any CPU
- {81360AA9-0DD6-4A49-8D6E-05AD3160391E}.Debug|x86.Build.0 = Debug|Any CPU
- {81360AA9-0DD6-4A49-8D6E-05AD3160391E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {81360AA9-0DD6-4A49-8D6E-05AD3160391E}.Release|Any CPU.Build.0 = Release|Any CPU
- {81360AA9-0DD6-4A49-8D6E-05AD3160391E}.Release|arm64.ActiveCfg = Release|Any CPU
- {81360AA9-0DD6-4A49-8D6E-05AD3160391E}.Release|arm64.Build.0 = Release|Any CPU
- {81360AA9-0DD6-4A49-8D6E-05AD3160391E}.Release|x64.ActiveCfg = Release|Any CPU
- {81360AA9-0DD6-4A49-8D6E-05AD3160391E}.Release|x64.Build.0 = Release|Any CPU
- {81360AA9-0DD6-4A49-8D6E-05AD3160391E}.Release|x86.ActiveCfg = Release|Any CPU
- {81360AA9-0DD6-4A49-8D6E-05AD3160391E}.Release|x86.Build.0 = Release|Any CPU
- {EE945F20-366B-4273-878F-F8969992B8CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {EE945F20-366B-4273-878F-F8969992B8CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EE945F20-366B-4273-878F-F8969992B8CC}.Debug|arm64.ActiveCfg = Debug|Any CPU
- {EE945F20-366B-4273-878F-F8969992B8CC}.Debug|arm64.Build.0 = Debug|Any CPU
- {EE945F20-366B-4273-878F-F8969992B8CC}.Debug|x64.ActiveCfg = Debug|Any CPU
- {EE945F20-366B-4273-878F-F8969992B8CC}.Debug|x64.Build.0 = Debug|Any CPU
- {EE945F20-366B-4273-878F-F8969992B8CC}.Debug|x86.ActiveCfg = Debug|Any CPU
- {EE945F20-366B-4273-878F-F8969992B8CC}.Debug|x86.Build.0 = Debug|Any CPU
- {EE945F20-366B-4273-878F-F8969992B8CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EE945F20-366B-4273-878F-F8969992B8CC}.Release|Any CPU.Build.0 = Release|Any CPU
- {EE945F20-366B-4273-878F-F8969992B8CC}.Release|arm64.ActiveCfg = Release|Any CPU
- {EE945F20-366B-4273-878F-F8969992B8CC}.Release|arm64.Build.0 = Release|Any CPU
- {EE945F20-366B-4273-878F-F8969992B8CC}.Release|x64.ActiveCfg = Release|Any CPU
- {EE945F20-366B-4273-878F-F8969992B8CC}.Release|x64.Build.0 = Release|Any CPU
- {EE945F20-366B-4273-878F-F8969992B8CC}.Release|x86.ActiveCfg = Release|Any CPU
- {EE945F20-366B-4273-878F-F8969992B8CC}.Release|x86.Build.0 = Release|Any CPU
- {DC947B8B-E363-4104-A38A-0C3D08047D82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DC947B8B-E363-4104-A38A-0C3D08047D82}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DC947B8B-E363-4104-A38A-0C3D08047D82}.Debug|arm64.ActiveCfg = Debug|Any CPU
- {DC947B8B-E363-4104-A38A-0C3D08047D82}.Debug|arm64.Build.0 = Debug|Any CPU
- {DC947B8B-E363-4104-A38A-0C3D08047D82}.Debug|x64.ActiveCfg = Debug|Any CPU
- {DC947B8B-E363-4104-A38A-0C3D08047D82}.Debug|x64.Build.0 = Debug|Any CPU
- {DC947B8B-E363-4104-A38A-0C3D08047D82}.Debug|x86.ActiveCfg = Debug|Any CPU
- {DC947B8B-E363-4104-A38A-0C3D08047D82}.Debug|x86.Build.0 = Debug|Any CPU
- {DC947B8B-E363-4104-A38A-0C3D08047D82}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DC947B8B-E363-4104-A38A-0C3D08047D82}.Release|Any CPU.Build.0 = Release|Any CPU
- {DC947B8B-E363-4104-A38A-0C3D08047D82}.Release|arm64.ActiveCfg = Release|Any CPU
- {DC947B8B-E363-4104-A38A-0C3D08047D82}.Release|arm64.Build.0 = Release|Any CPU
- {DC947B8B-E363-4104-A38A-0C3D08047D82}.Release|x64.ActiveCfg = Release|Any CPU
- {DC947B8B-E363-4104-A38A-0C3D08047D82}.Release|x64.Build.0 = Release|Any CPU
- {DC947B8B-E363-4104-A38A-0C3D08047D82}.Release|x86.ActiveCfg = Release|Any CPU
- {DC947B8B-E363-4104-A38A-0C3D08047D82}.Release|x86.Build.0 = Release|Any CPU
- {B95580F0-895E-499B-BBE6-78258069DE02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B95580F0-895E-499B-BBE6-78258069DE02}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B95580F0-895E-499B-BBE6-78258069DE02}.Debug|arm64.ActiveCfg = Debug|Any CPU
- {B95580F0-895E-499B-BBE6-78258069DE02}.Debug|arm64.Build.0 = Debug|Any CPU
- {B95580F0-895E-499B-BBE6-78258069DE02}.Debug|x64.ActiveCfg = Debug|Any CPU
- {B95580F0-895E-499B-BBE6-78258069DE02}.Debug|x64.Build.0 = Debug|Any CPU
- {B95580F0-895E-499B-BBE6-78258069DE02}.Debug|x86.ActiveCfg = Debug|Any CPU
- {B95580F0-895E-499B-BBE6-78258069DE02}.Debug|x86.Build.0 = Debug|Any CPU
- {B95580F0-895E-499B-BBE6-78258069DE02}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B95580F0-895E-499B-BBE6-78258069DE02}.Release|Any CPU.Build.0 = Release|Any CPU
- {B95580F0-895E-499B-BBE6-78258069DE02}.Release|arm64.ActiveCfg = Release|Any CPU
- {B95580F0-895E-499B-BBE6-78258069DE02}.Release|arm64.Build.0 = Release|Any CPU
- {B95580F0-895E-499B-BBE6-78258069DE02}.Release|x64.ActiveCfg = Release|Any CPU
- {B95580F0-895E-499B-BBE6-78258069DE02}.Release|x64.Build.0 = Release|Any CPU
- {B95580F0-895E-499B-BBE6-78258069DE02}.Release|x86.ActiveCfg = Release|Any CPU
- {B95580F0-895E-499B-BBE6-78258069DE02}.Release|x86.Build.0 = Release|Any CPU
- {50653194-B56C-4270-85FD-9FF0A2C331AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {50653194-B56C-4270-85FD-9FF0A2C331AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {50653194-B56C-4270-85FD-9FF0A2C331AD}.Debug|arm64.ActiveCfg = Debug|Any CPU
- {50653194-B56C-4270-85FD-9FF0A2C331AD}.Debug|arm64.Build.0 = Debug|Any CPU
- {50653194-B56C-4270-85FD-9FF0A2C331AD}.Debug|x64.ActiveCfg = Debug|Any CPU
- {50653194-B56C-4270-85FD-9FF0A2C331AD}.Debug|x64.Build.0 = Debug|Any CPU
- {50653194-B56C-4270-85FD-9FF0A2C331AD}.Debug|x86.ActiveCfg = Debug|Any CPU
- {50653194-B56C-4270-85FD-9FF0A2C331AD}.Debug|x86.Build.0 = Debug|Any CPU
- {50653194-B56C-4270-85FD-9FF0A2C331AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {50653194-B56C-4270-85FD-9FF0A2C331AD}.Release|Any CPU.Build.0 = Release|Any CPU
- {50653194-B56C-4270-85FD-9FF0A2C331AD}.Release|arm64.ActiveCfg = Release|Any CPU
- {50653194-B56C-4270-85FD-9FF0A2C331AD}.Release|arm64.Build.0 = Release|Any CPU
- {50653194-B56C-4270-85FD-9FF0A2C331AD}.Release|x64.ActiveCfg = Release|Any CPU
- {50653194-B56C-4270-85FD-9FF0A2C331AD}.Release|x64.Build.0 = Release|Any CPU
- {50653194-B56C-4270-85FD-9FF0A2C331AD}.Release|x86.ActiveCfg = Release|Any CPU
- {50653194-B56C-4270-85FD-9FF0A2C331AD}.Release|x86.Build.0 = Release|Any CPU
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Debug|Any CPU.ActiveCfg = Debug|x64
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Debug|Any CPU.Build.0 = Debug|x64
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Debug|Any CPU.Deploy.0 = Debug|x64
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Debug|arm64.ActiveCfg = Debug|arm64
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Debug|arm64.Build.0 = Debug|arm64
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Debug|arm64.Deploy.0 = Debug|arm64
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Debug|x64.ActiveCfg = Debug|x64
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Debug|x64.Build.0 = Debug|x64
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Debug|x64.Deploy.0 = Debug|x64
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Debug|x86.ActiveCfg = Debug|x86
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Debug|x86.Build.0 = Debug|x86
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Debug|x86.Deploy.0 = Debug|x86
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Release|Any CPU.ActiveCfg = Release|x64
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Release|Any CPU.Build.0 = Release|x64
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Release|Any CPU.Deploy.0 = Release|x64
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Release|arm64.ActiveCfg = Release|arm64
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Release|arm64.Build.0 = Release|arm64
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Release|arm64.Deploy.0 = Release|arm64
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Release|x64.ActiveCfg = Release|x64
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Release|x64.Build.0 = Release|x64
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Release|x64.Deploy.0 = Release|x64
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Release|x86.ActiveCfg = Release|x86
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Release|x86.Build.0 = Release|x86
- {73850D1A-5384-49EC-8115-6FA27E6423D0}.Release|x86.Deploy.0 = Release|x86
- {A04E983D-5631-4C68-B34A-796970E060C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A04E983D-5631-4C68-B34A-796970E060C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A04E983D-5631-4C68-B34A-796970E060C0}.Debug|arm64.ActiveCfg = Debug|Any CPU
- {A04E983D-5631-4C68-B34A-796970E060C0}.Debug|arm64.Build.0 = Debug|Any CPU
- {A04E983D-5631-4C68-B34A-796970E060C0}.Debug|x64.ActiveCfg = Debug|Any CPU
- {A04E983D-5631-4C68-B34A-796970E060C0}.Debug|x64.Build.0 = Debug|Any CPU
- {A04E983D-5631-4C68-B34A-796970E060C0}.Debug|x86.ActiveCfg = Debug|Any CPU
- {A04E983D-5631-4C68-B34A-796970E060C0}.Debug|x86.Build.0 = Debug|Any CPU
- {A04E983D-5631-4C68-B34A-796970E060C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A04E983D-5631-4C68-B34A-796970E060C0}.Release|Any CPU.Build.0 = Release|Any CPU
- {A04E983D-5631-4C68-B34A-796970E060C0}.Release|arm64.ActiveCfg = Release|Any CPU
- {A04E983D-5631-4C68-B34A-796970E060C0}.Release|arm64.Build.0 = Release|Any CPU
- {A04E983D-5631-4C68-B34A-796970E060C0}.Release|x64.ActiveCfg = Release|Any CPU
- {A04E983D-5631-4C68-B34A-796970E060C0}.Release|x64.Build.0 = Release|Any CPU
- {A04E983D-5631-4C68-B34A-796970E060C0}.Release|x86.ActiveCfg = Release|Any CPU
- {A04E983D-5631-4C68-B34A-796970E060C0}.Release|x86.Build.0 = Release|Any CPU
- {A4A97F4E-71C1-42FA-84DC-7D4A41079A13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A4A97F4E-71C1-42FA-84DC-7D4A41079A13}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A4A97F4E-71C1-42FA-84DC-7D4A41079A13}.Debug|arm64.ActiveCfg = Debug|Any CPU
- {A4A97F4E-71C1-42FA-84DC-7D4A41079A13}.Debug|arm64.Build.0 = Debug|Any CPU
- {A4A97F4E-71C1-42FA-84DC-7D4A41079A13}.Debug|x64.ActiveCfg = Debug|Any CPU
- {A4A97F4E-71C1-42FA-84DC-7D4A41079A13}.Debug|x64.Build.0 = Debug|Any CPU
- {A4A97F4E-71C1-42FA-84DC-7D4A41079A13}.Debug|x86.ActiveCfg = Debug|Any CPU
- {A4A97F4E-71C1-42FA-84DC-7D4A41079A13}.Debug|x86.Build.0 = Debug|Any CPU
- {A4A97F4E-71C1-42FA-84DC-7D4A41079A13}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A4A97F4E-71C1-42FA-84DC-7D4A41079A13}.Release|Any CPU.Build.0 = Release|Any CPU
- {A4A97F4E-71C1-42FA-84DC-7D4A41079A13}.Release|arm64.ActiveCfg = Release|Any CPU
- {A4A97F4E-71C1-42FA-84DC-7D4A41079A13}.Release|arm64.Build.0 = Release|Any CPU
- {A4A97F4E-71C1-42FA-84DC-7D4A41079A13}.Release|x64.ActiveCfg = Release|Any CPU
- {A4A97F4E-71C1-42FA-84DC-7D4A41079A13}.Release|x64.Build.0 = Release|Any CPU
- {A4A97F4E-71C1-42FA-84DC-7D4A41079A13}.Release|x86.ActiveCfg = Release|Any CPU
- {A4A97F4E-71C1-42FA-84DC-7D4A41079A13}.Release|x86.Build.0 = Release|Any CPU
- {EECF393D-0F55-4BFE-AEA8-7FD90383C05D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {EECF393D-0F55-4BFE-AEA8-7FD90383C05D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EECF393D-0F55-4BFE-AEA8-7FD90383C05D}.Debug|arm64.ActiveCfg = Debug|Any CPU
- {EECF393D-0F55-4BFE-AEA8-7FD90383C05D}.Debug|arm64.Build.0 = Debug|Any CPU
- {EECF393D-0F55-4BFE-AEA8-7FD90383C05D}.Debug|x64.ActiveCfg = Debug|Any CPU
- {EECF393D-0F55-4BFE-AEA8-7FD90383C05D}.Debug|x64.Build.0 = Debug|Any CPU
- {EECF393D-0F55-4BFE-AEA8-7FD90383C05D}.Debug|x86.ActiveCfg = Debug|Any CPU
- {EECF393D-0F55-4BFE-AEA8-7FD90383C05D}.Debug|x86.Build.0 = Debug|Any CPU
- {EECF393D-0F55-4BFE-AEA8-7FD90383C05D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EECF393D-0F55-4BFE-AEA8-7FD90383C05D}.Release|Any CPU.Build.0 = Release|Any CPU
- {EECF393D-0F55-4BFE-AEA8-7FD90383C05D}.Release|arm64.ActiveCfg = Release|Any CPU
- {EECF393D-0F55-4BFE-AEA8-7FD90383C05D}.Release|arm64.Build.0 = Release|Any CPU
- {EECF393D-0F55-4BFE-AEA8-7FD90383C05D}.Release|x64.ActiveCfg = Release|Any CPU
- {EECF393D-0F55-4BFE-AEA8-7FD90383C05D}.Release|x64.Build.0 = Release|Any CPU
- {EECF393D-0F55-4BFE-AEA8-7FD90383C05D}.Release|x86.ActiveCfg = Release|Any CPU
- {EECF393D-0F55-4BFE-AEA8-7FD90383C05D}.Release|x86.Build.0 = Release|Any CPU
- {84E993AA-5343-4502-9612-B9A416AF243F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {84E993AA-5343-4502-9612-B9A416AF243F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {84E993AA-5343-4502-9612-B9A416AF243F}.Debug|arm64.ActiveCfg = Debug|Any CPU
- {84E993AA-5343-4502-9612-B9A416AF243F}.Debug|arm64.Build.0 = Debug|Any CPU
- {84E993AA-5343-4502-9612-B9A416AF243F}.Debug|x64.ActiveCfg = Debug|Any CPU
- {84E993AA-5343-4502-9612-B9A416AF243F}.Debug|x64.Build.0 = Debug|Any CPU
- {84E993AA-5343-4502-9612-B9A416AF243F}.Debug|x86.ActiveCfg = Debug|Any CPU
- {84E993AA-5343-4502-9612-B9A416AF243F}.Debug|x86.Build.0 = Debug|Any CPU
- {84E993AA-5343-4502-9612-B9A416AF243F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {84E993AA-5343-4502-9612-B9A416AF243F}.Release|Any CPU.Build.0 = Release|Any CPU
- {84E993AA-5343-4502-9612-B9A416AF243F}.Release|arm64.ActiveCfg = Release|Any CPU
- {84E993AA-5343-4502-9612-B9A416AF243F}.Release|arm64.Build.0 = Release|Any CPU
- {84E993AA-5343-4502-9612-B9A416AF243F}.Release|x64.ActiveCfg = Release|Any CPU
- {84E993AA-5343-4502-9612-B9A416AF243F}.Release|x64.Build.0 = Release|Any CPU
- {84E993AA-5343-4502-9612-B9A416AF243F}.Release|x86.ActiveCfg = Release|Any CPU
- {84E993AA-5343-4502-9612-B9A416AF243F}.Release|x86.Build.0 = Release|Any CPU
- {6C5EA367-5663-420E-B10C-8E5543EBF8DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6C5EA367-5663-420E-B10C-8E5543EBF8DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6C5EA367-5663-420E-B10C-8E5543EBF8DD}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
- {6C5EA367-5663-420E-B10C-8E5543EBF8DD}.Debug|arm64.ActiveCfg = Debug|Any CPU
- {6C5EA367-5663-420E-B10C-8E5543EBF8DD}.Debug|arm64.Build.0 = Debug|Any CPU
- {6C5EA367-5663-420E-B10C-8E5543EBF8DD}.Debug|x64.ActiveCfg = Debug|Any CPU
- {6C5EA367-5663-420E-B10C-8E5543EBF8DD}.Debug|x64.Build.0 = Debug|Any CPU
- {6C5EA367-5663-420E-B10C-8E5543EBF8DD}.Debug|x86.ActiveCfg = Debug|Any CPU
- {6C5EA367-5663-420E-B10C-8E5543EBF8DD}.Debug|x86.Build.0 = Debug|Any CPU
- {6C5EA367-5663-420E-B10C-8E5543EBF8DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6C5EA367-5663-420E-B10C-8E5543EBF8DD}.Release|Any CPU.Build.0 = Release|Any CPU
- {6C5EA367-5663-420E-B10C-8E5543EBF8DD}.Release|arm64.ActiveCfg = Release|Any CPU
- {6C5EA367-5663-420E-B10C-8E5543EBF8DD}.Release|arm64.Build.0 = Release|Any CPU
- {6C5EA367-5663-420E-B10C-8E5543EBF8DD}.Release|x64.ActiveCfg = Release|Any CPU
- {6C5EA367-5663-420E-B10C-8E5543EBF8DD}.Release|x64.Build.0 = Release|Any CPU
- {6C5EA367-5663-420E-B10C-8E5543EBF8DD}.Release|x86.ActiveCfg = Release|Any CPU
- {6C5EA367-5663-420E-B10C-8E5543EBF8DD}.Release|x86.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {7AC63864-7638-41C4-969C-D3197EF2BED9} = {FCF55611-6E25-4F1E-8E88-705896171E71}
- {0485EE3E-3745-4E79-A396-19AE493FA9D3} = {FCF55611-6E25-4F1E-8E88-705896171E71}
- {2C93516E-87C6-4212-8A85-95D85AB23098} = {FCF55611-6E25-4F1E-8E88-705896171E71}
- {665598EE-10CA-4842-B169-F5A6EF483C7F} = {52FA15AF-CAE7-4822-9975-F5E812EDEF33}
- {85B419CD-F64D-459E-A287-2C4775E75FD6} = {FCF55611-6E25-4F1E-8E88-705896171E71}
- {81360AA9-0DD6-4A49-8D6E-05AD3160391E} = {FCF55611-6E25-4F1E-8E88-705896171E71}
- {EE945F20-366B-4273-878F-F8969992B8CC} = {40478FA5-043C-415E-984B-2DBACCBB97A6}
- {DC947B8B-E363-4104-A38A-0C3D08047D82} = {52FA15AF-CAE7-4822-9975-F5E812EDEF33}
- {B95580F0-895E-499B-BBE6-78258069DE02} = {52FA15AF-CAE7-4822-9975-F5E812EDEF33}
- {50653194-B56C-4270-85FD-9FF0A2C331AD} = {52FA15AF-CAE7-4822-9975-F5E812EDEF33}
- {73850D1A-5384-49EC-8115-6FA27E6423D0} = {52FA15AF-CAE7-4822-9975-F5E812EDEF33}
- {A04E983D-5631-4C68-B34A-796970E060C0} = {52FA15AF-CAE7-4822-9975-F5E812EDEF33}
- {A4A97F4E-71C1-42FA-84DC-7D4A41079A13} = {FCF55611-6E25-4F1E-8E88-705896171E71}
- {EECF393D-0F55-4BFE-AEA8-7FD90383C05D} = {FCF55611-6E25-4F1E-8E88-705896171E71}
- {84E993AA-5343-4502-9612-B9A416AF243F} = {FCF55611-6E25-4F1E-8E88-705896171E71}
- {6C5EA367-5663-420E-B10C-8E5543EBF8DD} = {52FA15AF-CAE7-4822-9975-F5E812EDEF33}
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {C139BD97-A4F7-411B-99B1-824CE1ABA403}
- EndGlobalSection
- GlobalSection(SharedMSBuildProjectFiles) = preSolution
- src\apps\H.NotifyIcon.Apps.Uno.Shared\H.NotifyIcon.Apps.Uno.Shared.projitems*{418d1399-62c8-481b-a954-517b189eca70}*SharedItemsImports = 13
- src\apps\H.NotifyIcon.Apps.Uno.Shared\H.NotifyIcon.Apps.Uno.Shared.projitems*{abd64093-cfbc-4561-83fc-595dd16ef742}*SharedItemsImports = 5
- EndGlobalSection
-EndGlobal
diff --git a/H.NotifyIcon.slnx b/H.NotifyIcon.slnx
new file mode 100644
index 0000000..8668207
--- /dev/null
+++ b/H.NotifyIcon.slnx
@@ -0,0 +1,160 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/readme.md b/readme.md
index 31549f7..c8cd6cc 100644
--- a/readme.md
+++ b/readme.md
@@ -14,6 +14,7 @@ This is an implementation of a NotifyIcon (aka system tray icon or taskbar icon)
* [Design-time access](broken-reference)
* [Efficiency Mode](broken-reference)
* [Dynamic icon generation](broken-reference)
+* Trimming/NativeAOT support
#### NuGet
diff --git a/src/apps/H.NotifyIcon.Apps.Console/H.NotifyIcon.Apps.Console.csproj b/src/apps/H.NotifyIcon.Apps.Console/H.NotifyIcon.Apps.Console.csproj
index c6e1f6e..77daf67 100644
--- a/src/apps/H.NotifyIcon.Apps.Console/H.NotifyIcon.Apps.Console.csproj
+++ b/src/apps/H.NotifyIcon.Apps.Console/H.NotifyIcon.Apps.Console.csproj
@@ -1,28 +1,28 @@
-
-
-
- net4.8;net8.0-windows
- Exe
- preview
- enable
- enable
- true
-
-
-
-
-
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
-
-
-
+
+
+
+ net4.8;net9.0-windows
+ Exe
+ preview
+ enable
+ enable
+ true
+
+
+
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/apps/H.NotifyIcon.Apps.Maui/App.xaml.cs b/src/apps/H.NotifyIcon.Apps.Maui/App.xaml.cs
index 6f2ad0a..295f1ea 100644
--- a/src/apps/H.NotifyIcon.Apps.Maui/App.xaml.cs
+++ b/src/apps/H.NotifyIcon.Apps.Maui/App.xaml.cs
@@ -5,7 +5,10 @@ public partial class App : Application
public App()
{
InitializeComponent();
-
- MainPage = new AppShell();
}
+
+ protected override Window CreateWindow(IActivationState? activationState)
+ {
+ return new Window(new AppShell());
+ }
}
diff --git a/src/apps/H.NotifyIcon.Apps.Maui/H.NotifyIcon.Apps.Maui.csproj b/src/apps/H.NotifyIcon.Apps.Maui/H.NotifyIcon.Apps.Maui.csproj
index dab8cca..b3abdda 100644
--- a/src/apps/H.NotifyIcon.Apps.Maui/H.NotifyIcon.Apps.Maui.csproj
+++ b/src/apps/H.NotifyIcon.Apps.Maui/H.NotifyIcon.Apps.Maui.csproj
@@ -1,74 +1,72 @@
-
-
-
- $(TargetFrameworks);net8.0-maccatalyst
- $(TargetFrameworks);net8.0-windows10.0.19041.0
-
-
-
-
-
-
- Exe
- H.NotifyIcon.Apps.Maui
- true
- true
- enable
- enable
-
-
- H.NotifyIcon.Apps.Maui
-
-
- com.companyname.h.notifyicon.apps.maui
-
-
- 1.0
- 1
-
- 11.0
- 13.1
- 21.0
- 10.0.17763.0
- 10.0.17763.0
- 6.5
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ $(TargetFrameworks);net9.0-maccatalyst
+ $(TargetFrameworks);net9.0-windows10.0.19041.0
+
+
+
+
+
+
+ Exe
+ H.NotifyIcon.Apps.Maui
+ true
+ true
+ enable
+ enable
+
+
+ H.NotifyIcon.Apps.Maui
+
+
+ com.companyname.h.notifyicon.apps.maui
+
+
+ 1.0
+ 1
+
+ 12.2
+ 15.0
+ 21.0
+ 10.0.17763.0
+ 10.0.17763.0
+ 6.5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/apps/H.NotifyIcon.Apps.Maui/MainPage.xaml.cs b/src/apps/H.NotifyIcon.Apps.Maui/MainPage.xaml.cs
index fdcaebf..ae0d754 100644
--- a/src/apps/H.NotifyIcon.Apps.Maui/MainPage.xaml.cs
+++ b/src/apps/H.NotifyIcon.Apps.Maui/MainPage.xaml.cs
@@ -17,7 +17,7 @@ public MainPage()
[RelayCommand]
public void ShowHideWindow()
{
- var window = Application.Current?.MainPage?.Window;
+ var window = Application.Current?.Windows[0];
if (window == null)
{
return;
diff --git a/src/apps/H.NotifyIcon.Apps.WinUI.Windowless/H.NotifyIcon.Apps.WinUI.Windowless.csproj b/src/apps/H.NotifyIcon.Apps.WinUI.Windowless/H.NotifyIcon.Apps.WinUI.Windowless.csproj
index e39edf4..e84854f 100644
--- a/src/apps/H.NotifyIcon.Apps.WinUI.Windowless/H.NotifyIcon.Apps.WinUI.Windowless.csproj
+++ b/src/apps/H.NotifyIcon.Apps.WinUI.Windowless/H.NotifyIcon.Apps.WinUI.Windowless.csproj
@@ -2,7 +2,7 @@
WinExe
- net8.0-windows10.0.18362.0
+ net9.0-windows10.0.18362.0
10.0.18362.0
x86;x64;arm64
true
@@ -22,12 +22,12 @@
-
-
+
+
-
+
diff --git a/src/apps/H.NotifyIcon.Apps.WinUI/H.NotifyIcon.Apps.WinUI.csproj b/src/apps/H.NotifyIcon.Apps.WinUI/H.NotifyIcon.Apps.WinUI.csproj
index 553310f..dae49e6 100644
--- a/src/apps/H.NotifyIcon.Apps.WinUI/H.NotifyIcon.Apps.WinUI.csproj
+++ b/src/apps/H.NotifyIcon.Apps.WinUI/H.NotifyIcon.Apps.WinUI.csproj
@@ -22,13 +22,13 @@
-
-
-
+
+
+
-
+
diff --git a/src/apps/H.NotifyIcon.Apps.Wpf.Windowless/H.NotifyIcon.Apps.Wpf.Windowless.csproj b/src/apps/H.NotifyIcon.Apps.Wpf.Windowless/H.NotifyIcon.Apps.Wpf.Windowless.csproj
index 8d5174b..fb3981b 100644
--- a/src/apps/H.NotifyIcon.Apps.Wpf.Windowless/H.NotifyIcon.Apps.Wpf.Windowless.csproj
+++ b/src/apps/H.NotifyIcon.Apps.Wpf.Windowless/H.NotifyIcon.Apps.Wpf.Windowless.csproj
@@ -2,7 +2,7 @@
WinExe
- net4.6.2;net8.0-windows
+ net4.6.2;net9.0-windows
true
preview
enable
@@ -11,7 +11,7 @@
-
+
diff --git a/src/apps/H.NotifyIcon.Apps.Wpf/H.NotifyIcon.Apps.Wpf.csproj b/src/apps/H.NotifyIcon.Apps.Wpf/H.NotifyIcon.Apps.Wpf.csproj
index dfbfe76..0bb3e1b 100644
--- a/src/apps/H.NotifyIcon.Apps.Wpf/H.NotifyIcon.Apps.Wpf.csproj
+++ b/src/apps/H.NotifyIcon.Apps.Wpf/H.NotifyIcon.Apps.Wpf.csproj
@@ -1,36 +1,36 @@
-
-
-
- WinExe
- net4.6.2;net8.0-windows
- true
- true
- preview
- enable
- enable
- true
-
-
-
-
- <_Parameter1>System.Windows.ResourceDictionaryLocation.None
- <_Parameter1_IsLiteral>true
- <_Parameter2>System.Windows.ResourceDictionaryLocation.SourceAssembly
- <_Parameter2_IsLiteral>true
-
-
-
-
-
- all
- compile; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
-
-
-
-
-
+
+
+
+ WinExe
+ net4.6.2;net9.0-windows
+ true
+ true
+ preview
+ enable
+ enable
+ true
+
+
+
+
+ <_Parameter1>System.Windows.ResourceDictionaryLocation.None
+ <_Parameter1_IsLiteral>true
+ <_Parameter2>System.Windows.ResourceDictionaryLocation.SourceAssembly
+ <_Parameter2_IsLiteral>true
+
+
+
+
+
+ all
+ compile; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/apps/TrimmingHelper/TrimmingHelper.csproj b/src/apps/TrimmingHelper/TrimmingHelper.csproj
index c7c89ce..7f3f5f4 100644
--- a/src/apps/TrimmingHelper/TrimmingHelper.csproj
+++ b/src/apps/TrimmingHelper/TrimmingHelper.csproj
@@ -2,7 +2,7 @@
Exe
- net8.0
+ net9.0
true
enable
@@ -15,6 +15,7 @@
+
diff --git a/src/libs/Directory.Build.props b/src/libs/Directory.Build.props
index 06cc851..255102c 100644
--- a/src/libs/Directory.Build.props
+++ b/src/libs/Directory.Build.props
@@ -1,87 +1,87 @@
-
-
-
-
-
-
- System.Drawing
- $(DefineConstants);HAS_SYSTEM_DRAWING
- $(DefineConstants);HAS_SKIA_SHARP
-
-
-
- true
- $(MSBuildThisFileDirectory)../key.snk
-
-
-
-
- <_Parameter1>true
-
-
-
-
- $(PACKAGE_RELEASE_NOTES)
- true
- true
- havendv
- MIT
- nuget_icon.png
- README.md
- https://github.com/HavenDV/H.NotifyIcon
-
-
-
-
-
-
-
-
- v
- dev
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
-
- true
-
-
-
- true
- latest
- All
- true
-
- $(NoWarn);CA1502;CA1506;CA1010;CA1822
-
-
-
- true
- true
- true
- false
- false
-
-
-
+
+
+
+
+
+
+ System.Drawing
+ $(DefineConstants);HAS_SYSTEM_DRAWING
+ $(DefineConstants);HAS_SKIA_SHARP
+
+
+
+ true
+ $(MSBuildThisFileDirectory)../key.snk
+
+
+
+
+ <_Parameter1>true
+
+
+
+
+ $(PACKAGE_RELEASE_NOTES)
+ true
+ true
+ havendv
+ MIT
+ nuget_icon.png
+ README.md
+ https://github.com/HavenDV/H.NotifyIcon
+
+
+
+
+
+
+
+
+ v
+ dev
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+ true
+
+
+
+ true
+ latest
+ All
+ true
+
+ $(NoWarn);CA1502;CA1506;CA1010;CA1822
+
+
+
+ true
+ true
+ true
+ false
+ false
+
+
+
diff --git a/src/libs/H.GeneratedIcons.SkiaSharp/H.GeneratedIcons.SkiaSharp.csproj b/src/libs/H.GeneratedIcons.SkiaSharp/H.GeneratedIcons.SkiaSharp.csproj
index fffd002..6fd8764 100644
--- a/src/libs/H.GeneratedIcons.SkiaSharp/H.GeneratedIcons.SkiaSharp.csproj
+++ b/src/libs/H.GeneratedIcons.SkiaSharp/H.GeneratedIcons.SkiaSharp.csproj
@@ -1,7 +1,7 @@
- net4.6.2;netstandard2.0;net6.0;net8.0
+ net4.6.2;netstandard2.0;net8.0;net9.0
@@ -9,7 +9,7 @@
-
+
diff --git a/src/libs/H.GeneratedIcons.SkiaSharp/SkiaSharpIconGenerator.cs b/src/libs/H.GeneratedIcons.SkiaSharp/SkiaSharpIconGenerator.cs
index c89dc7c..64e39e4 100644
--- a/src/libs/H.GeneratedIcons.SkiaSharp/SkiaSharpIconGenerator.cs
+++ b/src/libs/H.GeneratedIcons.SkiaSharp/SkiaSharpIconGenerator.cs
@@ -129,8 +129,7 @@ public static SKBitmap Generate(
{
if (textRectangle == null)
{
- var bounds = new SKRect();
- _ = foregroundBrush.MeasureText(text, ref bounds);
+ _ = font.MeasureText(text, out var bounds, foregroundBrush);
graphics.DrawText(
text: text,
diff --git a/src/libs/H.GeneratedIcons.System.Drawing/H.GeneratedIcons.System.Drawing.csproj b/src/libs/H.GeneratedIcons.System.Drawing/H.GeneratedIcons.System.Drawing.csproj
index 6c6383a..8e1c2ed 100644
--- a/src/libs/H.GeneratedIcons.System.Drawing/H.GeneratedIcons.System.Drawing.csproj
+++ b/src/libs/H.GeneratedIcons.System.Drawing/H.GeneratedIcons.System.Drawing.csproj
@@ -1,32 +1,28 @@
-
-
-
- net4.6.2;netstandard2.0;net6.0;net8.0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This package allows to generate icons.
- tray-icon;notify-icon;interop;console;generator;icon;system;drawing
-
-
+
+
+
+ net4.6.2;netstandard2.0;net8.0;net9.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This package allows to generate icons.
+ tray-icon;notify-icon;interop;console;generator;icon;system;drawing
+
+
\ No newline at end of file
diff --git a/src/libs/H.NotifyIcon.Maui/H.NotifyIcon.Maui.csproj b/src/libs/H.NotifyIcon.Maui/H.NotifyIcon.Maui.csproj
index 995a567..1c55627 100644
--- a/src/libs/H.NotifyIcon.Maui/H.NotifyIcon.Maui.csproj
+++ b/src/libs/H.NotifyIcon.Maui/H.NotifyIcon.Maui.csproj
@@ -1,17 +1,17 @@
- net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst;net8.0-windows10.0.19041.0
+ net9.0;net9.0-android;net9.0-ios;net9.0-maccatalyst;net9.0-windows10.0.19041.0
true
$(DefineConstants);HAS_PLATFORM_CODE;HAS_MAUI
- $(DefineConstants);HAS_MAUI_WINUI
+ $(DefineConstants);HAS_MAUI_WINUI
$(NoWarn);CA1031;CS8002;CS0108;CA1501;CA1513
true
- 11.0
- 13.1
+ 12.2
+ 15.0
21.0
10.0.17763.0
10.0.17763.0
@@ -40,11 +40,10 @@ popups, context menus, and balloon messages. It can be used directly in code or
-
-
+
all
compile; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/libs/H.NotifyIcon.Shared/TaskbarIcon.ContextMenu.WinUI.SecondWindow.cs b/src/libs/H.NotifyIcon.Shared/TaskbarIcon.ContextMenu.WinUI.SecondWindow.cs
index 321b524..1e06b2e 100644
--- a/src/libs/H.NotifyIcon.Shared/TaskbarIcon.ContextMenu.WinUI.SecondWindow.cs
+++ b/src/libs/H.NotifyIcon.Shared/TaskbarIcon.ContextMenu.WinUI.SecondWindow.cs
@@ -99,7 +99,7 @@ private void PrepareContextMenuWindow()
AreOpenCloseAnimationsEnabled = ContextFlyout.AreOpenCloseAnimationsEnabled,
Placement = FlyoutPlacementMode.Full,
};
- flyout.Closed += async (_, _) =>
+ flyout.Closed += (_, _) =>
{
if (!flyout.AreOpenCloseAnimationsEnabled ||
!IsContextMenuVisible)
@@ -108,7 +108,6 @@ private void PrepareContextMenuWindow()
return;
}
- await Task.Delay(1).ConfigureAwait(true);
flyout.ShowAt(window.Content, new FlyoutShowOptions
{
ShowMode = FlyoutShowMode.Transient,
diff --git a/src/libs/H.NotifyIcon.Shared/Utilities/ImageExtensions.Maui.cs b/src/libs/H.NotifyIcon.Shared/Utilities/ImageExtensions.Maui.cs
index 6fa7caf..9b36476 100644
--- a/src/libs/H.NotifyIcon.Shared/Utilities/ImageExtensions.Maui.cs
+++ b/src/libs/H.NotifyIcon.Shared/Utilities/ImageExtensions.Maui.cs
@@ -1,9 +1,23 @@
namespace H.NotifyIcon;
-internal static partial class ImageExtensions
+///
+/// Provides MAUI-specific extension methods for converting ImageSource objects to streams.
+///
+public static partial class ImageExtensions
{
+ ///
+ /// Converts an ImageSource to a Stream for MAUI applications.
+ ///
+ /// The ImageSource to convert.
+ /// A Stream representation of the ImageSource.
+ /// Thrown when imageSource is null.
+ /// Thrown when the ImageSource type is not supported.
+ /// Thrown when the file specified in FileImageSource is not found.
+ [CLSCompliant(false)]
public static Stream ToStream(this ImageSource imageSource)
{
+ imageSource = imageSource ?? throw new ArgumentNullException(nameof(imageSource));
+
switch (imageSource)
{
case FileImageSource bitmapImage:
@@ -16,8 +30,21 @@ public static Stream ToStream(this ImageSource imageSource)
}
}
+ ///
+ /// Asynchronously converts an ImageSource to a Stream for MAUI applications.
+ ///
+ /// The ImageSource to convert.
+ /// A token to cancel the operation.
+ /// A task that represents the asynchronous operation. The task result contains a Stream representation of the ImageSource.
+ /// Thrown when imageSource is null.
+ /// Thrown when the ImageSource type is not supported.
+ /// Thrown when the operation is cancelled.
+ /// Thrown when the file specified in FileImageSource is not found in the app package.
+ [CLSCompliant(false)]
public static async Task ToStreamAsync(this ImageSource imageSource, CancellationToken cancellationToken = default)
{
+ imageSource = imageSource ?? throw new ArgumentNullException(nameof(imageSource));
+
switch(imageSource)
{
case FileImageSource bitmapImage:
diff --git a/src/libs/H.NotifyIcon.Shared/Utilities/ImageExtensions.WinRT.cs b/src/libs/H.NotifyIcon.Shared/Utilities/ImageExtensions.WinRT.cs
index c08f41a..c8287ba 100644
--- a/src/libs/H.NotifyIcon.Shared/Utilities/ImageExtensions.WinRT.cs
+++ b/src/libs/H.NotifyIcon.Shared/Utilities/ImageExtensions.WinRT.cs
@@ -1,8 +1,18 @@
namespace H.NotifyIcon;
-internal static partial class ImageExtensions
+///
+/// Provides WinRT-specific extension methods for converting ImageSource objects and URIs to streams.
+///
+public static partial class ImageExtensions
{
#if !HAS_MAUI
+ ///
+ /// Converts a URI to a Stream, supporting ms-appx and ms-appx-web schemes.
+ ///
+ /// The URI to convert to a stream.
+ /// A Stream representation of the URI content.
+ /// Thrown when uri is null.
+ /// Thrown when the file specified by the URI is not found.
internal static Stream ToStream(this Uri uri)
{
var prefix = uri.Scheme switch
@@ -17,6 +27,15 @@ internal static Stream ToStream(this Uri uri)
return File.OpenRead(absolutePath);
}
+ ///
+ /// Asynchronously converts a URI to a Stream, with special handling for UWP applications.
+ ///
+ /// The URI to convert to a stream.
+ /// A token to cancel the operation.
+ /// A task that represents the asynchronous operation. The task result contains a Stream representation of the URI content.
+ /// Thrown when uri is null.
+ /// Thrown when the file specified by the URI is not found.
+ /// Thrown when the operation is cancelled.
internal static async Task ToStreamAsync(this Uri uri, CancellationToken cancellationToken = default)
{
#if IS_PACKABLE
@@ -31,8 +50,19 @@ internal static async Task ToStreamAsync(this Uri uri, CancellationToken
return uri.ToStream();
}
+ ///
+ /// Converts an ImageSource to a Stream for WinRT applications.
+ ///
+ /// The ImageSource to convert.
+ /// A Stream representation of the ImageSource.
+ /// Thrown when imageSource is null.
+ /// Thrown when the ImageSource type is not supported.
+ /// Thrown when the image file is not found.
+ [CLSCompliant(false)]
public static Stream ToStream(this ImageSource imageSource)
{
+ imageSource = imageSource ?? throw new ArgumentNullException(nameof(imageSource));
+
switch (imageSource)
{
case BitmapImage bitmapImage:
@@ -47,8 +77,21 @@ public static Stream ToStream(this ImageSource imageSource)
}
}
+ ///
+ /// Asynchronously converts an ImageSource to a Stream for WinRT applications.
+ ///
+ /// The ImageSource to convert.
+ /// A token to cancel the operation.
+ /// A task that represents the asynchronous operation. The task result contains a Stream representation of the ImageSource.
+ /// Thrown when imageSource is null.
+ /// Thrown when the ImageSource type is not supported.
+ /// Thrown when the operation is cancelled.
+ /// Thrown when the image file is not found.
+ [CLSCompliant(false)]
public static async Task ToStreamAsync(this ImageSource imageSource, CancellationToken cancellationToken = default)
{
+ imageSource = imageSource ?? throw new ArgumentNullException(nameof(imageSource));
+
switch(imageSource)
{
case BitmapImage bitmapImage:
diff --git a/src/libs/H.NotifyIcon.Shared/Utilities/ImageExtensions.Wpf.cs b/src/libs/H.NotifyIcon.Shared/Utilities/ImageExtensions.Wpf.cs
index 894a248..4b1e9d9 100644
--- a/src/libs/H.NotifyIcon.Shared/Utilities/ImageExtensions.Wpf.cs
+++ b/src/libs/H.NotifyIcon.Shared/Utilities/ImageExtensions.Wpf.cs
@@ -2,10 +2,23 @@
namespace H.NotifyIcon;
-internal static partial class ImageExtensions
+///
+/// Provides WPF-specific extension methods for converting ImageSource objects, URIs, and bitmap objects to streams.
+///
+public static partial class ImageExtensions
{
- internal static Stream ToStream(this Uri uri)
+ ///
+ /// Converts a URI to a Stream, supporting file URIs and application resource URIs.
+ ///
+ /// The URI to convert to a stream.
+ /// A Stream representation of the URI content.
+ /// Thrown when uri is null.
+ /// Thrown when the URI cannot be resolved.
+ /// Thrown when the file specified by the URI is not found.
+ public static Stream ToStream(this Uri uri)
{
+ uri = uri ?? throw new ArgumentNullException(nameof(uri));
+
if (uri.Scheme == Uri.UriSchemeFile)
{
return File.OpenRead(uri.LocalPath);
@@ -18,13 +31,33 @@ internal static Stream ToStream(this Uri uri)
return streamInfo.Stream;
}
- internal static Task ToStreamAsync(this Uri uri, CancellationToken cancellationToken = default)
+ ///
+ /// Asynchronously converts a URI to a Stream.
+ ///
+ /// The URI to convert to a stream.
+ /// A token to cancel the operation.
+ /// A task that represents the asynchronous operation. The task result contains a Stream representation of the URI content.
+ /// Thrown when uri is null.
+ /// Thrown when the URI cannot be resolved.
+ /// Thrown when the file specified by the URI is not found.
+ public static Task ToStreamAsync(this Uri uri, CancellationToken cancellationToken = default)
{
return Task.FromResult(uri.ToStream());
}
+ ///
+ /// Converts an ImageSource to a Stream for WPF applications.
+ ///
+ /// The ImageSource to convert.
+ /// A Stream representation of the ImageSource.
+ /// Thrown when imageSource is null.
+ /// Thrown when the ImageSource type is not supported.
+ /// Thrown when the ImageSource URI cannot be resolved.
+ /// Thrown when the image file is not found.
public static Stream ToStream(this ImageSource imageSource)
{
+ imageSource = imageSource ?? throw new ArgumentNullException(nameof(imageSource));
+
switch (imageSource)
{
case BitmapImage bitmapImage:
@@ -45,8 +78,21 @@ public static Stream ToStream(this ImageSource imageSource)
}
}
+ ///
+ /// Asynchronously converts an ImageSource to a Stream for WPF applications.
+ ///
+ /// The ImageSource to convert.
+ /// A token to cancel the operation.
+ /// A task that represents the asynchronous operation. The task result contains a Stream representation of the ImageSource.
+ /// Thrown when imageSource is null.
+ /// Thrown when the ImageSource type is not supported.
+ /// Thrown when the operation is cancelled.
+ /// Thrown when the ImageSource URI cannot be resolved.
+ /// Thrown when the image file is not found.
public static async Task ToStreamAsync(this ImageSource imageSource, CancellationToken cancellationToken = default)
{
+ imageSource = imageSource ?? throw new ArgumentNullException(nameof(imageSource));
+
switch(imageSource)
{
case BitmapImage bitmapImage:
@@ -67,6 +113,12 @@ public static async Task ToStreamAsync(this ImageSource imageSource, Can
}
}
+ ///
+ /// Converts a BitmapFrame to a Stream in ICO format.
+ ///
+ /// The BitmapFrame to convert.
+ /// A Stream containing the BitmapFrame data in ICO format.
+ /// Thrown when frame is null.
public static Stream ToStream(this BitmapFrame frame)
{
var encoder = new PngBitmapEncoder();
@@ -80,6 +132,12 @@ public static Stream ToStream(this BitmapFrame frame)
return new MemoryStream(iconBytes);
}
+ ///
+ /// Converts a BitmapSource to a Stream in ICO format.
+ ///
+ /// The BitmapSource to convert.
+ /// A Stream containing the BitmapSource data in ICO format.
+ /// Thrown when bitmap is null.
public static Stream ToStream(this BitmapSource bitmap)
{
return BitmapFrame.Create(bitmap).ToStream();
diff --git a/src/libs/H.NotifyIcon.Shared/Utilities/ImageExtensions.cs b/src/libs/H.NotifyIcon.Shared/Utilities/ImageExtensions.cs
index fd29c05..21ba7b6 100644
--- a/src/libs/H.NotifyIcon.Shared/Utilities/ImageExtensions.cs
+++ b/src/libs/H.NotifyIcon.Shared/Utilities/ImageExtensions.cs
@@ -1,8 +1,18 @@
namespace H.NotifyIcon;
-internal static partial class ImageExtensions
+///
+/// Provides extension methods for converting ImageSource objects to various formats.
+///
+public static partial class ImageExtensions
{
+ ///
+ /// Converts an ImageSource to a System.Drawing.Bitmap.
+ ///
+ /// The ImageSource to convert.
+ /// A Bitmap representation of the ImageSource.
+ /// Thrown when imageSource is null.
[SupportedOSPlatform("windows")]
+ [CLSCompliant(false)]
public static Bitmap ToBitmap(this ImageSource imageSource)
{
if (imageSource is GeneratedIconSource generatedIconSource)
@@ -15,7 +25,14 @@ public static Bitmap ToBitmap(this ImageSource imageSource)
return stream.ToBitmap();
}
+ ///
+ /// Converts an ImageSource to a System.Drawing.Icon.
+ ///
+ /// The ImageSource to convert.
+ /// An Icon representation of the ImageSource.
+ /// Thrown when imageSource is null.
[SupportedOSPlatform("windows5.0")]
+ [CLSCompliant(false)]
public static Icon ToIcon(this ImageSource imageSource)
{
if (imageSource is GeneratedIconSource generatedIconSource)
@@ -28,7 +45,16 @@ public static Icon ToIcon(this ImageSource imageSource)
return stream.ToSmallIcon();
}
+ ///
+ /// Asynchronously converts an ImageSource to a System.Drawing.Bitmap.
+ ///
+ /// The ImageSource to convert.
+ /// A token to cancel the operation.
+ /// A task that represents the asynchronous operation. The task result contains a Bitmap representation of the ImageSource.
+ /// Thrown when imageSource is null.
+ /// Thrown when the operation is cancelled.
[SupportedOSPlatform("windows")]
+ [CLSCompliant(false)]
public static async Task ToBitmapAsync(this ImageSource imageSource, CancellationToken cancellationToken = default)
{
if (imageSource is GeneratedIconSource generatedIconSource)
@@ -41,7 +67,16 @@ public static async Task ToBitmapAsync(this ImageSource imageSource, Can
return stream.ToBitmap();
}
+ ///
+ /// Asynchronously converts an ImageSource to a System.Drawing.Icon.
+ ///
+ /// The ImageSource to convert.
+ /// A token to cancel the operation.
+ /// A task that represents the asynchronous operation. The task result contains an Icon representation of the ImageSource.
+ /// Thrown when imageSource is null.
+ /// Thrown when the operation is cancelled.
[SupportedOSPlatform("windows5.0")]
+ [CLSCompliant(false)]
public static async Task ToIconAsync(this ImageSource imageSource, CancellationToken cancellationToken = default)
{
if (imageSource is GeneratedIconSource generatedIconSource)
diff --git a/src/libs/H.NotifyIcon.Shared/Utilities/PngToIcoConverter.cs b/src/libs/H.NotifyIcon.Shared/Utilities/PngToIcoConverter.cs
index 43b16de..5124130 100644
--- a/src/libs/H.NotifyIcon.Shared/Utilities/PngToIcoConverter.cs
+++ b/src/libs/H.NotifyIcon.Shared/Utilities/PngToIcoConverter.cs
@@ -1,12 +1,25 @@
namespace H.NotifyIcon;
-internal static class PngToIcoConverter
+///
+/// Provides functionality to convert PNG image data to ICO format.
+///
+public static class PngToIcoConverter
{
+ ///
+ /// Converts a PNG image byte array to an ICO image byte array.
+ ///
+ /// The byte array containing PNG image data.
+ /// A byte array containing the ICO image data.
[SupportedOSPlatform("windows")]
public static byte[] ConvertPngToIco(this byte[] data)
{
+ if (data == null || data.Length == 0)
+ {
+ throw new ArgumentException("Data cannot be null or empty.");
+ }
+
using var inStream = new MemoryStream(data);
- var metadata = inStream.GetMetadata();
+ var metadata = inStream.GetMetadata(); // Custom metadata retrieval
using var outStream = new MemoryStream();
// Header
@@ -49,9 +62,15 @@ public static byte[] ConvertPngToIco(this byte[] data)
// Data
outStream.Write(data, 0, data.Length);
}
+
return outStream.ToArray();
}
+ ///
+ /// Converts an integer to a 2-byte little-endian byte array.
+ ///
+ /// The integer to convert.
+ /// A 2-byte little-endian byte array.
private static byte[] IntToLittle2(int input)
{
byte[] b = new byte[2];
@@ -59,6 +78,12 @@ private static byte[] IntToLittle2(int input)
b[1] = (byte)(((uint)input >> 8) & 0xFF);
return b;
}
+
+ ///
+ /// Converts an integer to a 4-byte little-endian byte array.
+ ///
+ /// The integer to convert.
+ /// A 4-byte little-endian byte array.
private static byte[] IntToLittle4(int input)
{
byte[] b = new byte[4];
diff --git a/src/libs/H.NotifyIcon.Uno.WinUI/H.NotifyIcon.Uno.WinUI.csproj b/src/libs/H.NotifyIcon.Uno.WinUI/H.NotifyIcon.Uno.WinUI.csproj
index d8a45f9..f84ee85 100644
--- a/src/libs/H.NotifyIcon.Uno.WinUI/H.NotifyIcon.Uno.WinUI.csproj
+++ b/src/libs/H.NotifyIcon.Uno.WinUI/H.NotifyIcon.Uno.WinUI.csproj
@@ -11,14 +11,6 @@
true
-
-
-
-
-
-
-
-
This is an implementation of a NotifyIcon (aka system tray icon or taskbar icon) for the Uno.WinUI Skia.Wpf platform.
It does not just rely on the Windows Forms NotifyIcon component,
@@ -29,7 +21,7 @@ popups, context menus, and balloon messages. It can be used directly in code or
-
+
all
compile; build; native; contentfiles; analyzers; buildtransitive
@@ -43,4 +35,26 @@ popups, context menus, and balloon messages. It can be used directly in code or
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/libs/H.NotifyIcon.Uno/H.NotifyIcon.Uno.csproj b/src/libs/H.NotifyIcon.Uno/H.NotifyIcon.Uno.csproj
index bfccf67..a8ce206 100644
--- a/src/libs/H.NotifyIcon.Uno/H.NotifyIcon.Uno.csproj
+++ b/src/libs/H.NotifyIcon.Uno/H.NotifyIcon.Uno.csproj
@@ -10,7 +10,7 @@
-
+
@@ -23,7 +23,7 @@ popups, context menus, and balloon messages. It can be used directly in code or
-
+
all
compile; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/libs/H.NotifyIcon.WinUI/H.NotifyIcon.WinUI.csproj b/src/libs/H.NotifyIcon.WinUI/H.NotifyIcon.WinUI.csproj
index 0776bcd..8b59496 100644
--- a/src/libs/H.NotifyIcon.WinUI/H.NotifyIcon.WinUI.csproj
+++ b/src/libs/H.NotifyIcon.WinUI/H.NotifyIcon.WinUI.csproj
@@ -1,7 +1,7 @@
- net8.0-windows10.0.17763.0
+ net8.0-windows10.0.17763.0;net8.0-windows10.0.17763.0
true
$(DefineConstants);HAS_WINUI;IS_PACKABLE;HAS_PLATFORM_CODE
$(NoWarn);CS3021;CA1031;CS8002;CA1513;NETSDK1206
@@ -11,7 +11,9 @@
-
+
+
+
@@ -24,7 +26,7 @@ popups, context menus, and balloon messages. It can be used directly in code or
-
+
all
compile; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/libs/H.NotifyIcon.Wpf/H.NotifyIcon.Wpf.csproj b/src/libs/H.NotifyIcon.Wpf/H.NotifyIcon.Wpf.csproj
index 4254926..cd25f29 100644
--- a/src/libs/H.NotifyIcon.Wpf/H.NotifyIcon.Wpf.csproj
+++ b/src/libs/H.NotifyIcon.Wpf/H.NotifyIcon.Wpf.csproj
@@ -1,7 +1,7 @@
- net4.6.2;net6.0-windows;net8.0-windows
+ net4.6.2;net8.0-windows;net9.0-windows
true
$(DefineConstants);HAS_WPF;HAS_PLATFORM_CODE
Hardcodet.Wpf.TaskbarNotification
@@ -45,7 +45,7 @@ popups, context menus, and balloon messages. It can be used directly in code or
-
+
all
compile; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/libs/H.NotifyIcon/Core/TrayInfo.cs b/src/libs/H.NotifyIcon/Core/TrayInfo.cs
index b23ee4b..9e5d97b 100644
--- a/src/libs/H.NotifyIcon/Core/TrayInfo.cs
+++ b/src/libs/H.NotifyIcon/Core/TrayInfo.cs
@@ -15,7 +15,7 @@ public static class TrayInfo
/// Tray coordinates.
public static bool IsShellOpen()
{
- return PInvoke.FindWindow("Shell_TrayWnd", null).Value != IntPtr.Zero;
+ return !PInvoke.FindWindow("Shell_TrayWnd", null).IsNull;
}
///
@@ -24,7 +24,7 @@ public static bool IsShellOpen()
/// Tray coordinates.
public static bool IsNotifyIconOverflowWindowOpen()
{
- return PInvoke.FindWindow("NotifyIconOverflowWindow", null).Value != IntPtr.Zero;
+ return !PInvoke.FindWindow("NotifyIconOverflowWindow", null).IsNull;
}
///
diff --git a/src/libs/H.NotifyIcon/Core/WindowUtilities.cs b/src/libs/H.NotifyIcon/Core/WindowUtilities.cs
index 29dcc16..130197f 100644
--- a/src/libs/H.NotifyIcon/Core/WindowUtilities.cs
+++ b/src/libs/H.NotifyIcon/Core/WindowUtilities.cs
@@ -182,7 +182,7 @@ private static unsafe LRESULT WindowSubClass(HWND hWnd, uint uMsg, WPARAM wParam
lprc: &rect,
hbr: hBrush).EnsureNonZero();
_ = PInvoke.DeleteObject(
- ho: new HGDIOBJ(hBrush)).EnsureNonZero();
+ ho: hBrush).EnsureNonZero();
return new LRESULT(1);
}
diff --git a/src/libs/H.NotifyIcon/H.NotifyIcon.csproj b/src/libs/H.NotifyIcon/H.NotifyIcon.csproj
index 60d930b..b773aee 100644
--- a/src/libs/H.NotifyIcon/H.NotifyIcon.csproj
+++ b/src/libs/H.NotifyIcon/H.NotifyIcon.csproj
@@ -1,93 +1,96 @@
-
-
-
- net4.6.2;netstandard2.0;net6.0;net8.0
- $(NoWarn);CA1031;CA1003;CA1502;CS3016;CS8981;CA1513
-
-
-
- This package allows to create TrayIcon for any platform.
- tray-icon;notify-icon;interop;console;ecoqos;eco;qos;quality-of-service;efficiency-mode
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- all
- compile; build; native; contentfiles; analyzers; buildtransitive
-
-
- all
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ net4.6.2;netstandard2.0;net8.0;net9.0
+ $(NoWarn);CA1031;CA1003;CA1502;CS3016;CS8981;CA1513
+ System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute
+
+
+
+ This package allows to create TrayIcon for any platform.
+ tray-icon;notify-icon;interop;console;ecoqos;eco;qos;quality-of-service;efficiency-mode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ all
+ compile; build; native; contentfiles; analyzers; buildtransitive
+
+
+ all
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/libs/H.NotifyIcon/Interop/InteropUtilities.cs b/src/libs/H.NotifyIcon/Interop/InteropUtilities.cs
index 2239278..010680a 100644
--- a/src/libs/H.NotifyIcon/Interop/InteropUtilities.cs
+++ b/src/libs/H.NotifyIcon/Interop/InteropUtilities.cs
@@ -7,7 +7,7 @@ internal static class InteropUtilities
///
public static HWND EnsureNonNull(this HWND value)
{
- if (value.Value == IntPtr.Zero)
+ if (value.IsNull)
{
Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error());
}
diff --git a/src/libs/H.NotifyIcon/PopupMenus/PopupMenu.cs b/src/libs/H.NotifyIcon/PopupMenus/PopupMenu.cs
index 2876894..7979a95 100644
--- a/src/libs/H.NotifyIcon/PopupMenus/PopupMenu.cs
+++ b/src/libs/H.NotifyIcon/PopupMenus/PopupMenu.cs
@@ -45,7 +45,7 @@ public void Show(nint ownerHandle, int x, int y)
var lastId = 1;
List safeHandles = new();
- void AppendToMenu(HMENU menu, ICollection items)
+ unsafe void AppendToMenu(HMENU menu, ICollection items)
{
var handle = new DestroyMenuSafeHandle(menu, true);
safeHandles.Add(handle);
@@ -57,7 +57,7 @@ BOOL AddSubMenu(PopupSubMenu subMenu, int itemId)
return PInvoke.AppendMenu(
hMenu: handle,
uFlags: MENU_ITEM_FLAGS.MF_POPUP,
- uIDNewItem: (nuint)subMenuHandle.Value.ToInt64(),
+ uIDNewItem: (nuint)subMenuHandle.Value,
lpNewItem: subMenu.Text).EnsureNonZero();
}
diff --git a/src/tests/H.NotifyIcon.IntegrationTests/H.NotifyIcon.IntegrationTests.csproj b/src/tests/H.NotifyIcon.IntegrationTests/H.NotifyIcon.IntegrationTests.csproj
index 61eb093..495ad4c 100644
--- a/src/tests/H.NotifyIcon.IntegrationTests/H.NotifyIcon.IntegrationTests.csproj
+++ b/src/tests/H.NotifyIcon.IntegrationTests/H.NotifyIcon.IntegrationTests.csproj
@@ -1,33 +1,31 @@
-
-
-
- net4.8;net8.0-windows
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
-
-
-
-
+
+
+
+ net4.8;net9.0-windows
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
+
+
\ No newline at end of file