Skip to content

Commit 2f8e57a

Browse files
authored
Merge pull request #1 from andy83/xvtsharp/net10
Modernize Idmr.Platform for .NET 10
2 parents 8bde27b + 30da377 commit 2f8e57a

6 files changed

Lines changed: 73 additions & 158 deletions

File tree

.github/workflows/build.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [master, xvtsharp/net10]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v5
17+
with:
18+
path: idmr-platform
19+
20+
- uses: actions/checkout@v5
21+
with:
22+
repository: andy83/LdmrCommon
23+
ref: db9b9d7af6d7946ba5d9089245ec33504bd0a586
24+
path: idmr-common
25+
26+
- uses: actions/setup-dotnet@v5
27+
with:
28+
dotnet-version: 10.0.x
29+
30+
- name: Restore
31+
run: dotnet restore idmr-platform/Platform.csproj
32+
33+
- name: Build
34+
run: dotnet build idmr-platform/Platform.csproj --no-restore --configuration Release

EncodingSupport.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System.Runtime.CompilerServices;
2+
using System.Text;
3+
4+
namespace Idmr.Platform
5+
{
6+
internal static class EncodingSupport
7+
{
8+
[ModuleInitializer]
9+
internal static void RegisterCodePages()
10+
{
11+
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
12+
}
13+
}
14+
}

Platform.csproj

Lines changed: 19 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -1,153 +1,24 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project Sdk="Microsoft.NET.Sdk">
32
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProductVersion>9.0.21022</ProductVersion>
7-
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{ABE8BD2A-CFA2-4912-B635-AC7C52F81434}</ProjectGuid>
9-
<OutputType>Library</OutputType>
10-
<AppDesignerFolder>Properties</AppDesignerFolder>
11-
<RootNamespace>Idmr.Platform</RootNamespace>
3+
<TargetFramework>net10.0</TargetFramework>
124
<AssemblyName>Idmr.Platform</AssemblyName>
13-
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
14-
<FileAlignment>512</FileAlignment>
15-
<FileUpgradeFlags>
16-
</FileUpgradeFlags>
17-
<UpgradeBackupLocation>
18-
</UpgradeBackupLocation>
19-
<OldToolsVersion>3.5</OldToolsVersion>
20-
<TargetFrameworkProfile />
21-
</PropertyGroup>
22-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
23-
<DebugSymbols>true</DebugSymbols>
24-
<DebugType>full</DebugType>
25-
<Optimize>false</Optimize>
26-
<OutputPath>bin\Debug\</OutputPath>
27-
<DefineConstants>DEBUG;TRACE</DefineConstants>
28-
<ErrorReport>prompt</ErrorReport>
29-
<WarningLevel>4</WarningLevel>
30-
<Prefer32Bit>false</Prefer32Bit>
31-
</PropertyGroup>
32-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
33-
<DebugType>pdbonly</DebugType>
34-
<Optimize>true</Optimize>
35-
<OutputPath>bin\Release\</OutputPath>
36-
<DefineConstants>TRACE</DefineConstants>
37-
<ErrorReport>prompt</ErrorReport>
38-
<WarningLevel>4</WarningLevel>
39-
<DocumentationFile>bin\Release\Idmr.Platform.XML</DocumentationFile>
40-
<Prefer32Bit>false</Prefer32Bit>
5+
<RootNamespace>Idmr.Platform</RootNamespace>
6+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
7+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
8+
<ImplicitUsings>disable</ImplicitUsings>
9+
<Nullable>disable</Nullable>
10+
11+
<!-- The compatibility fork keeps the upstream source unchanged where possible. -->
12+
<EnableNETAnalyzers>false</EnableNETAnalyzers>
13+
<EnforceCodeStyleInBuild>false</EnforceCodeStyleInBuild>
14+
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
15+
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
16+
<NoWarn>$(NoWarn);CS0419;CS1591</NoWarn>
17+
18+
<IdmrCommonProject Condition="'$(IdmrCommonProject)' == ''">../idmr-common/Common.csproj</IdmrCommonProject>
4119
</PropertyGroup>
20+
4221
<ItemGroup>
43-
<Reference Include="Idmr.Common, Version=1.1.4354.13568, Culture=neutral, processorArchitecture=MSIL">
44-
<SpecificVersion>False</SpecificVersion>
45-
<HintPath>..\..\..\Libraries\Idmr.Common.dll</HintPath>
46-
</Reference>
47-
<Reference Include="System" />
48-
<Reference Include="System.Core">
49-
<RequiredTargetFramework>3.5</RequiredTargetFramework>
50-
</Reference>
51-
<Reference Include="System.Data" />
52-
<Reference Include="System.Windows.Forms" />
53-
<Reference Include="System.Xml" />
54-
</ItemGroup>
55-
<ItemGroup>
56-
<Compile Include="BaseBriefing.cs" />
57-
<Compile Include="BaseFlightGroup.cs" />
58-
<Compile Include="BaseFlightGroup.BaseOrder.cs" />
59-
<Compile Include="BaseFlightGroup.Waypoint.cs" />
60-
<Compile Include="BaseMessage.cs" />
61-
<Compile Include="BaseStrings.cs" />
62-
<Compile Include="BaseTrigger.cs" />
63-
<Compile Include="Briefing.EventCollection.cs" />
64-
<Compile Include="Converter.cs" />
65-
<Compile Include="MissionFile.cs" />
66-
<Compile Include="Properties\AssemblyInfo.cs" />
67-
<Compile Include="Tie\Briefing.cs" />
68-
<Compile Include="Tie\FlightGroup.cs" />
69-
<Compile Include="Tie\FlightGroup.FGGoals.cs" />
70-
<Compile Include="Tie\FlightGroup.Order.cs" />
71-
<Compile Include="Tie\FlightGroupCollection.cs" />
72-
<Compile Include="Tie\Globals.cs" />
73-
<Compile Include="Tie\Globals.Goal.cs" />
74-
<Compile Include="Tie\Message.cs" />
75-
<Compile Include="Tie\MessageCollection.cs" />
76-
<Compile Include="Tie\Mission.cs" />
77-
<Compile Include="Tie\Mission.IffNameIndexer.cs" />
78-
<Compile Include="Tie\Mission.Trigger.cs" />
79-
<Compile Include="Tie\Questions.cs" />
80-
<Compile Include="Tie\Strings.cs" />
81-
<Compile Include="Xvt\Briefing.cs" />
82-
<Compile Include="Xvt\BriefingCollection.cs" />
83-
<Compile Include="Xvt\FlightGroup.cs" />
84-
<Compile Include="Xvt\FlightGroup.Goal.cs" />
85-
<Compile Include="Xvt\FlightGroup.LoadoutIndexer.cs" />
86-
<Compile Include="Xvt\FlightGroup.Order.cs" />
87-
<Compile Include="Xvt\FlightGroupCollection.cs" />
88-
<Compile Include="Xvt\Globals.cs" />
89-
<Compile Include="Xvt\Globals.Goal.cs" />
90-
<Compile Include="Xvt\Globals.Goal.Trigger.cs" />
91-
<Compile Include="Xvt\GlobalsCollection.cs" />
92-
<Compile Include="Xvt\Message.cs" />
93-
<Compile Include="Xvt\MessageCollection.cs" />
94-
<Compile Include="Xvt\Mission.cs" />
95-
<Compile Include="Xvt\Mission.IffNameIndexer.cs" />
96-
<Compile Include="Xvt\Mission.Trigger.cs" />
97-
<Compile Include="Xvt\Strings.cs" />
98-
<Compile Include="Xvt\Team.cs" />
99-
<Compile Include="Xvt\TeamCollection.cs" />
100-
<Compile Include="Xwa\Briefing.cs" />
101-
<Compile Include="Xwa\BriefingCollection.cs" />
102-
<Compile Include="Xwa\FlightGroup.cs" />
103-
<Compile Include="Xwa\FlightGroup.Goal.cs" />
104-
<Compile Include="Xwa\FlightGroup.LoadoutIndexer.cs" />
105-
<Compile Include="Xwa\FlightGroup.Order.cs" />
106-
<Compile Include="Xwa\FlightGroup.XwaWaypoint.cs" />
107-
<Compile Include="Xwa\FlightGroupCollection.cs" />
108-
<Compile Include="Xwa\Globals.cs" />
109-
<Compile Include="Xwa\Globals.Goal.cs" />
110-
<Compile Include="Xwa\Globals.Goal.StringsIndexer.cs" />
111-
<Compile Include="Xwa\GlobalsCollection.cs" />
112-
<Compile Include="Xwa\Message.cs" />
113-
<Compile Include="Xwa\MessageCollection.cs" />
114-
<Compile Include="Xwa\Mission.cs" />
115-
<Compile Include="Xwa\Mission.Trigger.cs" />
116-
<Compile Include="Xwa\Strings.cs" />
117-
<Compile Include="Xwa\Team.cs" />
118-
<Compile Include="Xwa\Team.EomMessageIndexer.cs" />
119-
<Compile Include="Xwa\Team.EomMessageNoteIndexer.cs" />
120-
<Compile Include="Xwa\Team.VoiceIDIndexer.cs" />
121-
<Compile Include="Xwa\TeamCollection.cs" />
122-
<Compile Include="Xwing\Briefing.EventCollection.cs" />
123-
<Compile Include="Xwing\Briefing.cs" />
124-
<Compile Include="Xwing\FlightGroup.cs" />
125-
<Compile Include="Xwing\FlightGroupCollection.cs" />
126-
<Compile Include="Xwing\Mission.cs" />
127-
<Compile Include="Xwing\Strings.cs" />
128-
</ItemGroup>
129-
<ItemGroup>
130-
<None Include="Mission_TIE95.txt" />
131-
<None Include="Mission_XvT.txt" />
132-
<None Include="Mission_XWA.txt" />
133-
<None Include="Mission_XWING95.txt" />
134-
<None Include="License.txt">
135-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
136-
</None>
137-
<None Include="Readme.md">
138-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
139-
</None>
22+
<ProjectReference Include="$(IdmrCommonProject)" />
14023
</ItemGroup>
141-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
142-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
143-
Other similar extension points exist, see Microsoft.Common.targets.
144-
<Target Name="BeforeBuild">
145-
</Target>
146-
<Target Name="AfterBuild">
147-
</Target>
148-
-->
149-
<PropertyGroup>
150-
<PostBuildEvent>copy /y "$(TargetPath)" "C:\Users\Me\Documents\Visual Studio 2008\Libraries\"
151-
if $(ConfigurationName) == Release copy /y "$(TargetDir)$(TargetName).xml" "C:\Users\Me\Documents\Visual Studio 2008\Libraries\"</PostBuildEvent>
152-
</PropertyGroup>
153-
</Project>
24+
</Project>

Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
[assembly: AssemblyTrademark("")]
2121
[assembly: AssemblyCulture("")]
2222

23-
[assembly: AssemblyVersion("7.4.1.*")]
23+
[assembly: AssemblyVersion("7.4.1.0")]
2424
[assembly: AssemblyFileVersion("7.4.1.0")]
25-
[assembly: AssemblyInformationalVersion("7.4 final")]
25+
[assembly: AssemblyInformationalVersion("7.4 final")]

Tie/MessageCollection.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
using System;
2020
using System.Collections.Generic;
21-
using System.Windows.Forms;
2221

2322
namespace Idmr.Platform.Tie
2423
{
@@ -36,12 +35,11 @@ public MessageCollection()
3635
/// <summary>Creates a new Collection with multiple initial Messages.</summary>
3736
/// <param name="quantity">Number of Messages to start with.</param>
3837
/// <exception cref="ArgumentOutOfRangeException"><paramref name="quantity"/> is less than <b>0</b>.</exception>
39-
/// <remarks>Exceeding <see cref="Common.ResizableCollection{T}.ItemLimit"/> will result in a warning and the excess ignored.</remarks>
38+
/// <remarks>Exceeding <see cref="Common.ResizableCollection{T}.ItemLimit"/> trims the excess.</remarks>
4039
public MessageCollection(int quantity) : this()
4140
{
4241
if (quantity > _itemLimit)
4342
{
44-
MessageBox.Show($"Maximum quantity ({_itemLimit}) exceeded, trimming excess.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
4543
quantity = _itemLimit;
4644
}
4745
if (quantity < 0) throw new ArgumentOutOfRangeException("quantity", "Invalid quantity, must be 0-" + _itemLimit);
@@ -132,4 +130,4 @@ public override void SetCount(int value, bool allowTruncate)
132130
else while (Count < value) Add();
133131
}
134132
}
135-
}
133+
}

Xvt/MessageCollection.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
using System;
2020
using System.Collections.Generic;
21-
using System.Windows.Forms;
2221

2322
namespace Idmr.Platform.Xvt
2423
{
@@ -36,12 +35,11 @@ public MessageCollection()
3635
/// <summary>Creates a new Collection with multiple initial Messages.</summary>
3736
/// <param name="quantity">Number of Messages to start with.</param>
3837
/// <exception cref="ArgumentOutOfRangeException"><paramref name="quantity"/> is less than <b>0</b>.</exception>
39-
/// <remarks>Exceeding <see cref="Common.ResizableCollection{T}.ItemLimit"/> will result in a warning and the excess ignored.</remarks>
38+
/// <remarks>Exceeding <see cref="Common.ResizableCollection{T}.ItemLimit"/> trims the excess.</remarks>
4039
public MessageCollection(int quantity) : this()
4140
{
4241
if (quantity > _itemLimit)
4342
{
44-
MessageBox.Show($"Maximum quantity ({_itemLimit}) exceeded, trimming excess.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
4543
quantity = _itemLimit;
4644
}
4745
if (quantity < 0) throw new ArgumentOutOfRangeException("quantity", "Invalid quantity, must be 0-" + _itemLimit);
@@ -131,4 +129,4 @@ public override void SetCount(int value, bool allowTruncate)
131129
else while (Count < value) Add();
132130
}
133131
}
134-
}
132+
}

0 commit comments

Comments
 (0)