mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Added UI elements borrowed from DarthAffe
Added a WIP of profile classes
This commit is contained in:
1 parent
4f146865a4
commit
6eefa733b4
23 files changed
+847
-108
No files matched your search
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user