mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 20:06:33 +00:00
Code cleanup
This commit is contained in:
1 parent
44eaa6ac40
commit
5340e6c6d4
70 files changed
+492
-488
No files matched your search
@@ -17,11 +17,11 @@ namespace Artemis.Core.Services.Storage
|
||||
public class SurfaceService : ISurfaceService
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
private readonly IRgbService _rgbService;
|
||||
private readonly IPluginService _pluginService;
|
||||
private readonly PluginSetting<double> _renderScaleSetting;
|
||||
private readonly IRgbService _rgbService;
|
||||
private readonly List<Surface> _surfaceConfigurations;
|
||||
private readonly ISurfaceRepository _surfaceRepository;
|
||||
private readonly PluginSetting<double> _renderScaleSetting;
|
||||
|
||||
internal SurfaceService(ILogger logger, ISurfaceRepository surfaceRepository, IRgbService rgbService, IPluginService pluginService, ISettingsService settingsService)
|
||||
{
|
||||
@@ -128,27 +128,6 @@ namespace Artemis.Core.Services.Storage
|
||||
}
|
||||
}
|
||||
|
||||
#region Event handlers
|
||||
|
||||
private void RgbServiceOnDeviceLoaded(object sender, DeviceEventArgs e)
|
||||
{
|
||||
lock (_surfaceConfigurations)
|
||||
{
|
||||
foreach (var surfaceConfiguration in _surfaceConfigurations)
|
||||
AddDeviceIfMissing(e.Device, surfaceConfiguration);
|
||||
}
|
||||
|
||||
UpdateSurfaceConfiguration(ActiveSurface, true);
|
||||
}
|
||||
|
||||
private void RenderScaleSettingOnSettingChanged(object sender, EventArgs e)
|
||||
{
|
||||
foreach (var surfaceConfiguration in SurfaceConfigurations)
|
||||
surfaceConfiguration.UpdateScale(_renderScaleSetting.Value);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Repository
|
||||
|
||||
private void LoadFromRepository()
|
||||
@@ -225,6 +204,27 @@ namespace Artemis.Core.Services.Storage
|
||||
|
||||
#endregion
|
||||
|
||||
#region Event handlers
|
||||
|
||||
private void RgbServiceOnDeviceLoaded(object sender, DeviceEventArgs e)
|
||||
{
|
||||
lock (_surfaceConfigurations)
|
||||
{
|
||||
foreach (var surfaceConfiguration in _surfaceConfigurations)
|
||||
AddDeviceIfMissing(e.Device, surfaceConfiguration);
|
||||
}
|
||||
|
||||
UpdateSurfaceConfiguration(ActiveSurface, true);
|
||||
}
|
||||
|
||||
private void RenderScaleSettingOnSettingChanged(object sender, EventArgs e)
|
||||
{
|
||||
foreach (var surfaceConfiguration in SurfaceConfigurations)
|
||||
surfaceConfiguration.UpdateScale(_renderScaleSetting.Value);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
|
||||
public event EventHandler<SurfaceConfigurationEventArgs> ActiveSurfaceConfigurationChanged;
|
||||
|
||||
Reference in new issue
Block a user