refactor settings load/save

- load using LINUQ
- load on child settings on demond
- prevent error when plugin has been removed
- prevent settings loose when plugin has been removed
This commit is contained in:
Pilzinsel64
2024-11-28 07:23:29 +01:00
parent 3070fab91b
commit 44ab301c24
3 changed files with 77 additions and 13 deletions

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Collections.Generic;
namespace Pilz.Configuration;
@@ -7,4 +8,6 @@ public interface ISettings
IReadOnlyCollection<IChildSettings> Childs { get; }
T Get<T>() where T : IChildSettings, ISettingsIdentifier;
void Reset();
string Save(JsonSerializerSettings serializer);
bool Load(JsonSerializerSettings serializer, string raw);
}