Update library and fixes

This commit is contained in:
MaddoScientisto 2026-02-04 21:12:27 +01:00
commit d73389d791
7 changed files with 50 additions and 14 deletions

View file

@ -225,7 +225,7 @@ namespace MaddoShared.Tests
miAdjust.Invoke(svc, parameters);
var updatedSize = (SizeF)parameters[3];
imageState.DimensioneStandardMiniatura.Should().BeLessOrEqualTo(30);
imageState.DimensioneStandardMiniatura.Should().BeLessThanOrEqualTo(30);
(updatedSize.Width <= 50 || imageState.DimensioneStandardMiniatura <= 5).Should().BeTrue();
}
}

View file

@ -9,14 +9,26 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Moq" Version="4.20.2" />
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.7" />
<PackageReference Include="System.Drawing.Common" Version="9.0.7" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="FluentAssertions" Version="8.8.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.2" />
<PackageReference Include="System.Drawing.Common" Version="10.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MaddoShared\MaddoShared.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="18.0.1" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="MSTest.TestFramework" Version="4.1.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="MSTest.TestAdapter" Version="4.1.0" />
</ItemGroup>
</Project>

View file

@ -14,12 +14,12 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.7" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.2" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.7" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.10" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="10.0.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.12" />
<PackageReference Include="System.Buffers" Version="4.6.1" />
<PackageReference Include="System.Collections.Immutable" Version="9.0.7" />
<PackageReference Include="System.Collections.Immutable" Version="10.0.2" />
<PackageReference Include="System.Memory" Version="4.6.3" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.2" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.6.3" />
@ -27,6 +27,6 @@
<PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.4.421302">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Windows.Compatibility" Version="9.0.7" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="10.0.2" />
</ItemGroup>
</Project>

View file

@ -148,6 +148,7 @@ namespace ImageCatalog_2
{
_uiEnabled = value;
NotifyPropertyChanged();
NotifyPropertyChanged(nameof(UiDisabled));
}
}

View file

@ -39,9 +39,9 @@
<ProjectReference Include="..\MaddoShared\MaddoShared.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.7" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.7" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.7" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="10.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.2" />
<PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.4.421302">
<PrivateAssets>all</PrivateAssets>
</PackageReference>

View file

@ -132,6 +132,16 @@ public partial class MainForm
ComboBox5.SelectedItem = Model.LogoVerticalPosition;
}
private void RefreshComboBoxSelections()
{
// Update ComboBox selections to reflect loaded Model values
ComboBox1.SelectedItem = Model.VerticalPosition;
ComboBox2.SelectedItem = Model.HorizontalAlignment;
ComboBox3.SelectedItem = Model.FontName;
ComboBox4.SelectedItem = Model.LogoHorizontalPosition;
ComboBox5.SelectedItem = Model.LogoVerticalPosition;
}
private void Form1_Load(object sender, EventArgs e)
{
@ -281,6 +291,9 @@ public partial class MainForm
await Model.LoadSettingsFromFileAsync(openDialog.FileName);
// Refresh ComboBox selections to reflect loaded settings
RefreshComboBoxSelections();
// Update logo preview if logo file exists
if (File.Exists(Model.LogoFile))
{

View file

@ -58,6 +58,15 @@ namespace ImageCatalog_2.Services
if (prop.PropertyType == typeof(string))
{
value = _parametriSetup.LeggiParametroString(prop.Name);
// Don't update if empty string and current value is not empty
if (string.IsNullOrEmpty((string)value))
{
var currentValue = prop.GetValue(settings) as string;
if (!string.IsNullOrEmpty(currentValue))
{
continue; // Skip if no value in settings but there's a default
}
}
}
else if (prop.PropertyType == typeof(bool))
{
@ -78,9 +87,10 @@ namespace ImageCatalog_2.Services
prop.SetValue(settings, value);
}
catch
catch (Exception ex)
{
// Skip properties that can't be loaded
System.Diagnostics.Debug.WriteLine($"Failed to load property {prop.Name}: {ex.Message}");
}
}
});