Added UI elements borrowed from DarthAffe

Added a WIP of profile classes
This commit is contained in:
SpoinkyNL committed 2018-01-13 00:06:28 +01:00
1 parent 4f146865a4
commit 6eefa733b4
23 files changed
+847 -108

No files matched your search

+27 -6
View File
@@ -1,22 +1,26 @@
using System.Threading.Tasks;
using System;
using System.Threading.Tasks;
using Artemis.Core.Exceptions;
using Artemis.Core.Services.Interfaces;
namespace Artemis.Core.Services
{
public class CoreService : ICoreService
{
private readonly IRgbService _rgbService;
private readonly IPluginService _pluginService;
private readonly IDeviceService _deviceService;
public CoreService(IPluginService pluginService, IDeviceService deviceService)
public CoreService(IPluginService pluginService, IRgbService rgbService)
{
_pluginService = pluginService;
_deviceService = deviceService;
_rgbService = rgbService;
Task.Run(Initialize);
}
public void Dispose()
{
// Dispose services
_pluginService.Dispose();
}
@@ -24,9 +28,26 @@ namespace Artemis.Core.Services
private async Task Initialize()
{
if (IsInitialized)
throw new ArtemisCoreException("Cannot initialize the core as it is already initialized.");
// Initialize the services
await _pluginService.LoadPlugins();
await _deviceService.LoadDevices();
IsInitialized = true;
await _rgbService.LoadDevices();
OnInitialized();
}
#region Events
public event EventHandler Initialized;
private void OnInitialized()
{
IsInitialized = true;
Initialized?.Invoke(this, EventArgs.Empty);
}
#endregion
}
}