mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 11:26:27 +00:00
Invalid plugin settings will fall back to their type's default
Main window remembers it's position now Surface editor's surface list size is saved
This commit is contained in:
1 parent
1a98ef62d3
commit
5a8a2b2684
6 files changed
+75
-31
No files matched your search
@@ -21,7 +21,14 @@ namespace Artemis.Core.Plugins.Models
|
||||
_pluginSettingEntity = pluginSettingEntity;
|
||||
|
||||
Name = pluginSettingEntity.Name;
|
||||
Value = JsonConvert.DeserializeObject<T>(pluginSettingEntity.Value);
|
||||
try
|
||||
{
|
||||
Value = JsonConvert.DeserializeObject<T>(pluginSettingEntity.Value);
|
||||
}
|
||||
catch (JsonReaderException)
|
||||
{
|
||||
Value = default(T);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -86,5 +93,10 @@ namespace Artemis.Core.Plugins.Models
|
||||
{
|
||||
SettingChanged?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{nameof(Name)}: {Name}, {nameof(Value)}: {Value}, {nameof(HasChanged)}: {HasChanged}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user