Update library and fixes
This commit is contained in:
parent
1db874ce77
commit
d73389d791
7 changed files with 50 additions and 14 deletions
|
|
@ -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}");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue