mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +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
dcf5dbb696
commit
accf3bcb36
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