mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 11:26:27 +00:00
Added dialog system
Added surface delete
This commit is contained in:
1 parent
5cdde6e402
commit
ce383468ea
24 files changed
+470
-96
No files matched your search
@@ -1,6 +1,5 @@
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.Storage.Entities;
|
||||
using Artemis.Storage.Repositories;
|
||||
using Artemis.Storage.Repositories.Interfaces;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
@@ -8,6 +7,7 @@ namespace Artemis.Core.Plugins.Models
|
||||
{
|
||||
public class PluginSetting<T>
|
||||
{
|
||||
// ReSharper disable once NotAccessedField.Local
|
||||
private readonly PluginInfo _pluginInfo;
|
||||
private readonly PluginSettingEntity _pluginSettingEntity;
|
||||
private readonly IPluginSettingRepository _pluginSettingRepository;
|
||||
@@ -50,6 +50,9 @@ namespace Artemis.Core.Plugins.Models
|
||||
/// </summary>
|
||||
public void Save()
|
||||
{
|
||||
if (!HasChanged)
|
||||
return;
|
||||
|
||||
_pluginSettingEntity.Value = JsonConvert.SerializeObject(Value);
|
||||
_pluginSettingRepository.Save();
|
||||
}
|
||||
@@ -60,6 +63,9 @@ namespace Artemis.Core.Plugins.Models
|
||||
/// <returns></returns>
|
||||
public async Task SaveAsync()
|
||||
{
|
||||
if (!HasChanged)
|
||||
return;
|
||||
|
||||
_pluginSettingEntity.Value = JsonConvert.SerializeObject(Value);
|
||||
await _pluginSettingRepository.SaveAsync();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Artemis.Storage.Entities;
|
||||
using Artemis.Storage.Repositories;
|
||||
using Artemis.Storage.Repositories.Interfaces;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
@@ -28,7 +27,7 @@ namespace Artemis.Core.Plugins.Models
|
||||
var settingEntity = new PluginSettingEntity {Name = name, PluginGuid = _pluginInfo.Guid, Value = JsonConvert.SerializeObject(defaultValue)};
|
||||
_pluginSettingRepository.Add(settingEntity);
|
||||
_pluginSettingRepository.Save();
|
||||
|
||||
|
||||
_settingEntities.Add(name, settingEntity);
|
||||
return new PluginSetting<T>(_pluginInfo, _pluginSettingRepository, _settingEntities[name]);
|
||||
}
|
||||
|
||||
@@ -122,10 +122,11 @@ namespace Artemis.Core.Services.Storage
|
||||
|
||||
lock (_surfaceConfigurations)
|
||||
{
|
||||
var entity = surfaceConfiguration.SurfaceEntity;
|
||||
surfaceConfiguration.Destroy();
|
||||
_surfaceConfigurations.Remove(surfaceConfiguration);
|
||||
|
||||
_surfaceRepository.Remove(surfaceConfiguration.SurfaceEntity);
|
||||
_surfaceRepository.Remove(entity);
|
||||
_surfaceRepository.Save();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user