Skip to content

Commit 460b743

Browse files
committed
feat: update to .net10 + nuget packages
1 parent d36128d commit 460b743

7 files changed

Lines changed: 64 additions & 22 deletions

File tree

MouseTrap/FodyWeavers.xsd

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,27 @@
2929
</xs:element>
3030
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged32Assemblies" type="xs:string">
3131
<xs:annotation>
32-
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with line breaks.</xs:documentation>
32+
<xs:documentation>Obsolete, use UnmanagedWinX86Assemblies instead</xs:documentation>
33+
</xs:annotation>
34+
</xs:element>
35+
<xs:element minOccurs="0" maxOccurs="1" name="UnmanagedWinX86Assemblies" type="xs:string">
36+
<xs:annotation>
37+
<xs:documentation>A list of unmanaged X86 (32 bit) assembly names to include, delimited with line breaks.</xs:documentation>
3338
</xs:annotation>
3439
</xs:element>
3540
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged64Assemblies" type="xs:string">
3641
<xs:annotation>
37-
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with line breaks.</xs:documentation>
42+
<xs:documentation>Obsolete, use UnmanagedWinX64Assemblies instead.</xs:documentation>
43+
</xs:annotation>
44+
</xs:element>
45+
<xs:element minOccurs="0" maxOccurs="1" name="UnmanagedWinX64Assemblies" type="xs:string">
46+
<xs:annotation>
47+
<xs:documentation>A list of unmanaged X64 (64 bit) assembly names to include, delimited with line breaks.</xs:documentation>
48+
</xs:annotation>
49+
</xs:element>
50+
<xs:element minOccurs="0" maxOccurs="1" name="UnmanagedWinArm64Assemblies" type="xs:string">
51+
<xs:annotation>
52+
<xs:documentation>A list of unmanaged Arm64 (64 bit) assembly names to include, delimited with line breaks.</xs:documentation>
3853
</xs:annotation>
3954
</xs:element>
4055
<xs:element minOccurs="0" maxOccurs="1" name="PreloadOrder" type="xs:string">
@@ -73,6 +88,11 @@
7388
<xs:documentation>As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off.</xs:documentation>
7489
</xs:annotation>
7590
</xs:attribute>
91+
<xs:attribute name="DisableEventSubscription" type="xs:boolean">
92+
<xs:annotation>
93+
<xs:documentation>The attach method no longer subscribes to the `AppDomain.AssemblyResolve` (.NET 4.x) and `AssemblyLoadContext.Resolving` (.NET 6.0+) events.</xs:documentation>
94+
</xs:annotation>
95+
</xs:attribute>
7696
<xs:attribute name="LoadAtModuleInit" type="xs:boolean">
7797
<xs:annotation>
7898
<xs:documentation>Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code.</xs:documentation>
@@ -105,12 +125,27 @@
105125
</xs:attribute>
106126
<xs:attribute name="Unmanaged32Assemblies" type="xs:string">
107127
<xs:annotation>
108-
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with |.</xs:documentation>
128+
<xs:documentation>Obsolete, use UnmanagedWinX86Assemblies instead</xs:documentation>
129+
</xs:annotation>
130+
</xs:attribute>
131+
<xs:attribute name="UnmanagedWinX86Assemblies" type="xs:string">
132+
<xs:annotation>
133+
<xs:documentation>A list of unmanaged X86 (32 bit) assembly names to include, delimited with |.</xs:documentation>
109134
</xs:annotation>
110135
</xs:attribute>
111136
<xs:attribute name="Unmanaged64Assemblies" type="xs:string">
112137
<xs:annotation>
113-
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with |.</xs:documentation>
138+
<xs:documentation>Obsolete, use UnmanagedWinX64Assemblies instead</xs:documentation>
139+
</xs:annotation>
140+
</xs:attribute>
141+
<xs:attribute name="UnmanagedWinX64Assemblies" type="xs:string">
142+
<xs:annotation>
143+
<xs:documentation>A list of unmanaged X64 (64 bit) assembly names to include, delimited with |.</xs:documentation>
144+
</xs:annotation>
145+
</xs:attribute>
146+
<xs:attribute name="UnmanagedWinArm64Assemblies" type="xs:string">
147+
<xs:annotation>
148+
<xs:documentation>A list of unmanaged Arm64 (64 bit) assembly names to include, delimited with |.</xs:documentation>
114149
</xs:annotation>
115150
</xs:attribute>
116151
<xs:attribute name="PreloadOrder" type="xs:string">

MouseTrap/MouseTrap.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net8.0-windows</TargetFramework>
3+
<TargetFramework>net10.0-windows</TargetFramework>
44
<OutputType>WinExe</OutputType>
55
<UseWindowsForms>true</UseWindowsForms>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<OutputPath>bin\</OutputPath>
9+
<!--<Version>1.0.0.0 uses semantic versioning in CI </Version>-->
910

1011
<Title>MouseTrap</Title>
1112
<Description>MouseTrap is a small tool to map the cursor between multiple monitors with different resolutions and scaling settings.</Description>
@@ -20,9 +21,9 @@
2021
</PropertyGroup>
2122

2223
<ItemGroup>
23-
<PackageReference Include="TaskScheduler" Verson="2.8.21" Version="2.10.1" />
24-
<PackageReference Include="Costura.Fody" Version="5.7.0" PrivateAssets="All" />
25-
<PackageReference Include="Fody" Version="6.8.0" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
24+
<PackageReference Include="TaskScheduler" Verson="2.8.21" Version="2.12.2" />
25+
<PackageReference Include="Costura.Fody" Version="6.0.0" PrivateAssets="All" />
26+
<PackageReference Include="Fody" Version="6.9.3" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
2627
<PackageReference Include="TextCopy" Version="6.2.1" />
2728
</ItemGroup>
2829

MouseTrap/src/Forms/ConfigFrom.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@
99
namespace MouseTrap.Forms;
1010

1111
public partial class ConfigFrom : Form {
12+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
1213
public ServiceThread Service { get; set; }
14+
15+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
1316
public ScreenConfigCollection Screens { get; set; }
17+
1418
public Settings Settings { get; }
1519

1620
public ConfigFrom(ServiceThread service)
@@ -147,10 +151,10 @@ ScreenConfigCollection GetConfig()
147151
}
148152

149153

150-
protected override void OnClosing(CancelEventArgs e)
154+
protected override void OnFormClosing(FormClosingEventArgs e)
151155
{
152156
Settings.Save();
153-
base.OnClosing(e);
157+
base.OnFormClosing(e);
154158
}
155159
}
156160

MouseTrap/src/Forms/DiagnosticForm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public DiagnosticForm(ServiceThread service)
5555
MessageBox.Show("Diagnostic data copied to clipboard.");
5656
};
5757

58-
this.Closing += delegate {
58+
this.FormClosing += delegate {
5959
Service.RestoreOriginalState();
6060
};
6161

MouseTrap/src/Forms/ScreenConfigForm.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using MouseTrap.Models;
1+
using System.ComponentModel;
2+
using MouseTrap.Models;
23

34

45
namespace MouseTrap.Forms;
@@ -279,6 +280,7 @@ public void ToggleBottom(int? targetId = null, bool forceEnable = false, bool fo
279280
}
280281

281282

283+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
282284
public TargetScreenIdGetter GetTargetScreenId { get; set; }
283285

284286
public ScreenConfig GetConfig()

MouseTrap/src/Forms/TrayIcon.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,31 @@ public TrayIcon()
2727
};
2828
}
2929

30+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
3031
public Icon? Icon {
3132
get => NotifyIcon.Icon!;
3233
set => NotifyIcon.Icon = value;
3334
}
3435

36+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
3537
public string Text {
3638
get => NotifyIcon.Text;
3739
set => NotifyIcon.Text = value;
3840
}
3941

42+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
4043
public ContextMenuStrip ContextMenu {
4144
get => NotifyIcon.ContextMenuStrip!;
4245
set => NotifyIcon.ContextMenuStrip = value;
4346
}
4447

48+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
4549
public bool Visible {
4650
get => NotifyIcon.Visible;
4751
set => NotifyIcon.Visible = value;
4852
}
4953

54+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
5055
public TrayApplication? Application { get; set; }
5156

5257
public void Hide()

README.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,20 @@ different resolutions and scaling settings.
1010
For this tool to function correctly you should have:
1111

1212
- At least **Windows 10 Creators update** (Build 1703)
13-
- [**.NET 8 Runtime**](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) (in most cases it will notify you if the runtime is missing)
13+
- [**.NET 10 Runtime**](https://dotnet.microsoft.com/en-us/download/dotnet/10.0) (in most cases it will notify you if the runtime is missing)
1414

1515

1616
## Download and Setup
1717

1818
You can find the latest release here:
1919
> [Download](https://github.com/r-Larch/MouseTrap/releases)
2020
21-
You can install MouseTrap with **chocolatey**:
22-
```Powershell
23-
# install the package
24-
choco install mousetrap
25-
26-
# running it
27-
mousetrap
28-
```
29-
3021
## Changelog
3122

23+
### Version 1.0.21
24+
- **Migrate to .NET 10**
25+
- Discontinue `chocolatey` support
26+
3227
### Version 1.0.20
3328
- Add `chocolatey` support
3429

0 commit comments

Comments
 (0)