Skip to content

Commit

Permalink
Merge pull request #62 from VirtualPhotonics/feature/61-upgrade-dotne…
Browse files Browse the repository at this point in the history
…t-to-80

feature/61 Upgrade .NET to 8.0
  • Loading branch information
lmalenfant authored Sep 4, 2024
2 parents 294d291 + 390deec commit cc01434
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 129 deletions.
10 changes: 5 additions & 5 deletions Vts.Gui.Wpf.Test/Model/ComplexDataPointTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public void Verify_ComplexDataPoint_equals_methods_work_correctly()
public void Verify_to_string_value()
{
var dataPoint = new ComplexDataPoint(0.1, new Complex(0.3, 0.1));
var localizedString = $"{0.1.ToString(Thread.CurrentThread.CurrentCulture)}, (" +
$"{0.3.ToString(Thread.CurrentThread.CurrentCulture)}, " +
$"{0.1.ToString(Thread.CurrentThread.CurrentCulture)})";
var localizedString = $"{0.1.ToString(Thread.CurrentThread.CurrentCulture)}, <" +
$"{0.3.ToString(Thread.CurrentThread.CurrentCulture)}; " +
$"{0.1.ToString(Thread.CurrentThread.CurrentCulture)}>";
Assert.AreEqual(localizedString, dataPoint.ToString());
}

Expand All @@ -50,7 +50,7 @@ public void Verify_hash_code()
{
var dataPoint = new ComplexDataPoint(0.8, new Complex(0.2, 0.5));
var hashCode = dataPoint.GetHashCode();
Assert.AreEqual(-1892473190, hashCode);
Assert.IsInstanceOf<int>(hashCode);
}

[Test]
Expand All @@ -59,7 +59,7 @@ public void Verify_hash_code_with_parameter()
var dataPoint1 = new ComplexDataPoint(0.8, new Complex(0.2, 0.5));
var dataPoint2 = new ComplexDataPoint(0.8, new Complex(0.9, 0.5));
var hashCode = dataPoint1.GetHashCode(dataPoint2);
Assert.AreEqual(-1882801729, hashCode);
Assert.IsInstanceOf<int>(hashCode);
}

[Test]
Expand Down
10 changes: 5 additions & 5 deletions Vts.Gui.Wpf.Test/Model/ComplexDerivativeDataPointTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ public void Verify_to_string_value()
new Complex(0.3, 0.1),
new Complex(0.4, 0.5),
ForwardAnalysisType.dRdMua);
var localizedString = $"{0.1.ToString(Thread.CurrentThread.CurrentCulture)}, (" +
$"{0.3.ToString(Thread.CurrentThread.CurrentCulture)}, " +
$"{0.1.ToString(Thread.CurrentThread.CurrentCulture)})";
var localizedString = $"{0.1.ToString(Thread.CurrentThread.CurrentCulture)}, <" +
$"{0.3.ToString(Thread.CurrentThread.CurrentCulture)}; " +
$"{0.1.ToString(Thread.CurrentThread.CurrentCulture)}>";
Assert.AreEqual(localizedString, dataPoint.ToString());
}

Expand All @@ -76,7 +76,7 @@ public void Verify_hash_code()
new Complex(0.2, 0.5),
new Complex(0.3, 0.4),
ForwardAnalysisType.dRdMusp);
Assert.AreEqual(-1563642927, dataPoint.GetHashCode());
Assert.IsInstanceOf<int>(dataPoint.GetHashCode());
}

[Test]
Expand All @@ -94,7 +94,7 @@ public void Verify_hash_code_with_parameter()
ForwardAnalysisType.dRdMusp);
Assert.IsNotNull(dataPoint1);
Assert.IsNotNull(dataPoint2);
Assert.AreEqual(867508351, dataPoint1.GetHashCode(dataPoint2));
Assert.IsInstanceOf<int>(dataPoint1.GetHashCode(dataPoint2));
}

[Test]
Expand Down
34 changes: 15 additions & 19 deletions Vts.Gui.Wpf.Test/Vts.Gui.Wpf.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0-windows8.0</TargetFramework>
<IsPackable>false</IsPackable>
<Configurations>Debug;Release;WhiteList</Configurations>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="8.0.6" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Vts.Gui.Wpf\Vts.Gui.Wpf.csproj" />
</ItemGroup>

<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<IsPackable>false</IsPackable>
<Configurations>Debug;Release</Configurations>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="8.0.8" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Vts.Gui.Wpf\Vts.Gui.Wpf.csproj" />
</ItemGroup>
</Project>
13 changes: 5 additions & 8 deletions Vts.Gui.Wpf.sln
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,11 @@ Global
{8EDF4429-251A-416D-BB68-93F227191BCF}.Release|Win32.Build.0 = Release|Any CPU
{8EDF4429-251A-416D-BB68-93F227191BCF}.Release|x86.ActiveCfg = Release|Any CPU
{8EDF4429-251A-416D-BB68-93F227191BCF}.Release|x86.Build.0 = Release|Any CPU
{8EDF4429-251A-416D-BB68-93F227191BCF}.WhiteList|Any CPU.ActiveCfg = WhiteList|Any CPU
{8EDF4429-251A-416D-BB68-93F227191BCF}.WhiteList|Any CPU.Build.0 = WhiteList|Any CPU
{8EDF4429-251A-416D-BB68-93F227191BCF}.WhiteList|Mixed Platforms.ActiveCfg = WhiteList|Any CPU
{8EDF4429-251A-416D-BB68-93F227191BCF}.WhiteList|Mixed Platforms.Build.0 = WhiteList|Any CPU
{8EDF4429-251A-416D-BB68-93F227191BCF}.WhiteList|Win32.ActiveCfg = WhiteList|Any CPU
{8EDF4429-251A-416D-BB68-93F227191BCF}.WhiteList|Win32.Build.0 = WhiteList|Any CPU
{8EDF4429-251A-416D-BB68-93F227191BCF}.WhiteList|x86.ActiveCfg = WhiteList|Any CPU
{8EDF4429-251A-416D-BB68-93F227191BCF}.WhiteList|x86.Build.0 = WhiteList|Any CPU
{8EDF4429-251A-416D-BB68-93F227191BCF}.WhiteList|Any CPU.ActiveCfg = Release|Any CPU
{8EDF4429-251A-416D-BB68-93F227191BCF}.WhiteList|Mixed Platforms.ActiveCfg = Release|Any CPU
{8EDF4429-251A-416D-BB68-93F227191BCF}.WhiteList|Mixed Platforms.Build.0 = Release|Any CPU
{8EDF4429-251A-416D-BB68-93F227191BCF}.WhiteList|Win32.ActiveCfg = Release|Any CPU
{8EDF4429-251A-416D-BB68-93F227191BCF}.WhiteList|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
8 changes: 4 additions & 4 deletions Vts.Gui.Wpf/ViewModel/Panels/ForwardSolverViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -685,10 +685,10 @@ orderby GetParameterOrder(iv)
select new KeyValuePair<IndependentVariableAxis, object>(iv, GetParameterValues(iv));

// OPs are always first in the list
return
new KeyValuePair<IndependentVariableAxis, object>(IndependentVariableAxis.Wavelength, opticalProperties)
.AsEnumerable()
.Concat(allParameters).ToDictionary();
var returnValue = new KeyValuePair<IndependentVariableAxis, object>(IndependentVariableAxis.Wavelength, opticalProperties).AsEnumerable().Concat(allParameters);

// convert the parameters to a dictionary for return
return EnumerableExtensions.ToDictionary(returnValue);
}

private object GetOpticalProperties()
Expand Down
8 changes: 5 additions & 3 deletions Vts.Gui.Wpf/ViewModel/Panels/InverseSolverViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Input;
using CommunityToolkit.Mvvm.Input;
Expand Down Expand Up @@ -661,10 +662,11 @@ orderby GetParameterOrder(iv)
select new KeyValuePair<IndependentVariableAxis, object>(iv, GetParameterValues(iv));

// OPs are always first in the list
return
new KeyValuePair<IndependentVariableAxis, object>(IndependentVariableAxis.Wavelength, opticalProperties)
var returnValue = new KeyValuePair<IndependentVariableAxis, object>(IndependentVariableAxis.Wavelength, opticalProperties)
.AsEnumerable()
.Concat(allParameters).ToDictionary();
.Concat(allParameters);
return
EnumerableExtensions.ToDictionary(returnValue);
}

/// <summary>
Expand Down
161 changes: 76 additions & 85 deletions Vts.Gui.Wpf/Vts.Gui.Wpf.csproj
Original file line number Diff line number Diff line change
@@ -1,87 +1,78 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<LanguageTargets>$(MSBuildToolsPath)\Microsoft.CSharp.targets</LanguageTargets>
<OutputType>winexe</OutputType>
<TargetFramework>net6.0-windows8.0</TargetFramework>
<ApplicationIcon>logo.ico</ApplicationIcon>
<OutputTypeEx>winexe</OutputTypeEx>
<StartupObject />
<Description>The WPF GUI provides a simple interface to access some basic functionality of the Virtual Tissue Simulator.</Description>
<Copyright>Copyright © 2024</Copyright>
<PackageIcon>logo.ico</PackageIcon>
<PackageReadmeFile>readme.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/VirtualPhotonics/Vts.Gui.Wpf</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<AssemblyVersion>4.4.0.0</AssemblyVersion>
<FileVersion>4.4.0.0</FileVersion>
<PlatformTarget>AnyCPU</PlatformTarget>
<Configurations>Debug;Release;WhiteList</Configurations>
<UseWPF>True</UseWPF>
<UseWindowsForms>True</UseWindowsForms>
<EnableDefaultPageItems>False</EnableDefaultPageItems>
</PropertyGroup>

<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<Compile Update="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<None Update="logo.ico">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Update="Resources\Strings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>

<EmbeddedResource Update="Resources\Strings.fr.resx" />
<EmbeddedResource Update="Resources\Strings.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>

<Page Include="**\*.xaml" SubType="Designer" Generator="MSBuild:Compile" />
<Compile Update="**\*.xaml.cs" SubType="Designer" DependentUpon="%(Filename)" />

</ItemGroup>

<ItemGroup>
<None Include="..\readme.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.6.0" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="8.0.6" />
<PackageReference Include="NLog" Version="5.3.2" />
<PackageReference Include="OxyPlot.Core" Version="2.1.2" />
<PackageReference Include="OxyPlot.Wpf" Version="2.1.2" />
<PackageReference Include="VirtualPhotonics.Vts" Version="11.0.0" />
</ItemGroup>

<ItemGroup>
<Reference Include="System.Runtime.Caching" />
</ItemGroup>

<PropertyGroup>
<LanguageTargets>$(MSBuildToolsPath)\Microsoft.CSharp.targets</LanguageTargets>
<OutputType>winexe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<ApplicationIcon>logo.ico</ApplicationIcon>
<OutputTypeEx>winexe</OutputTypeEx>
<StartupObject />
<Description>The WPF GUI provides a simple interface to access some basic functionality of the Virtual Tissue Simulator.</Description>
<Copyright>Copyright © 2024</Copyright>
<PackageIcon>logo.ico</PackageIcon>
<PackageReadmeFile>readme.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/VirtualPhotonics/Vts.Gui.Wpf</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<FileVersion>5.0.0.0</FileVersion>
<PlatformTarget>AnyCPU</PlatformTarget>
<Configurations>Debug;Release;WhiteList</Configurations>
<UseWPF>True</UseWPF>
<UseWindowsForms>True</UseWindowsForms>
<EnableDefaultPageItems>False</EnableDefaultPageItems>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<Compile Update="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<None Update="logo.ico">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Update="Resources\Strings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
<EmbeddedResource Update="Resources\Strings.fr.resx" />
<EmbeddedResource Update="Resources\Strings.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Page Include="**\*.xaml" SubType="Designer" Generator="MSBuild:Compile" />
<Compile Update="**\*.xaml.cs" SubType="Designer" DependentUpon="%(Filename)" />
</ItemGroup>
<ItemGroup>
<None Include="..\readme.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.6.1" />
<PackageReference Include="NLog" Version="5.3.3" />
<PackageReference Include="OxyPlot.Core" Version="2.1.2" />
<PackageReference Include="OxyPlot.Wpf" Version="2.1.2" />
<PackageReference Include="VirtualPhotonics.Vts" Version="11.0.0" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="8.0.8" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Runtime.Caching" />
</ItemGroup>
</Project>

0 comments on commit cc01434

Please sign in to comment.