Marked all service implementations as internal

Core - Enabled XML docs
Modules - Added DI to module VMs
This commit is contained in:
Robert committed 2020-08-19 16:16:10 +02:00
1 parent 795b4d672b
commit aa3c3d6b95
29 files changed
+134 -46

No files matched your search

+8 -4
View File
@@ -27,7 +27,7 @@ namespace Artemis.Core.Services
/// <summary>
/// Provides Artemis's core update loop
/// </summary>
public class CoreService : ICoreService
internal class CoreService : ICoreService
{
private readonly Stopwatch _frameStopWatch;
private readonly ILogger _logger;
@@ -41,7 +41,7 @@ namespace Artemis.Core.Services
private IntroAnimation _introAnimation;
// ReSharper disable once UnusedParameter.Local - Storage migration service is injected early to ensure it runs before anything else
internal CoreService(ILogger logger, StorageMigrationService _, ISettingsService settingsService, IPluginService pluginService,
public CoreService(ILogger logger, StorageMigrationService _, ISettingsService settingsService, IPluginService pluginService,
IRgbService rgbService, ISurfaceService surfaceService, IProfileService profileService, IModuleService moduleService)
{
_logger = logger;
@@ -173,7 +173,10 @@ namespace Artemis.Core.Services
List<Module> modules;
lock (_modules)
{
modules = _modules.Where(m => m.IsActivated).OrderByDescending(m => m.PriorityCategory).ThenByDescending(m => m.Priority).ToList();
modules = _modules.Where(m => m.IsActivated || m.InternalExpandsMainDataModel)
.OrderByDescending(m => m.PriorityCategory)
.ThenByDescending(m => m.Priority)
.ToList();
}
// Update all active modules
@@ -194,7 +197,8 @@ namespace Artemis.Core.Services
canvas.Clear(new SKColor(0, 0, 0));
if (!ModuleRenderingDisabled)
{
foreach (var module in modules)
// While non-activated modules may be updated above if they expand the main data model, they may never render
foreach (var module in modules.Where(m => m.IsActivated))
module.Render(args.DeltaTime, _surfaceService.ActiveSurface, canvas, _rgbService.BitmapBrush.Bitmap.Info);
}
@@ -20,14 +20,14 @@ namespace Artemis.Core.Services
/// <summary>
/// Provides access to the main data model
/// </summary>
public class DataModelService : IDataModelService
internal class DataModelService : IDataModelService
{
private readonly List<DataModel> _dataModelExpansions;
private readonly IPluginService _pluginService;
private readonly ILogger _logger;
private readonly List<DisplayConditionOperator> _registeredConditionOperators;
internal DataModelService(IPluginService pluginService, ILogger logger)
public DataModelService(IPluginService pluginService, ILogger logger)
{
_pluginService = pluginService;
_logger = logger;
+1 -1
View File
@@ -6,7 +6,7 @@ using SkiaSharp;
namespace Artemis.Core.Services
{
public class DeviceService : IDeviceService
internal class DeviceService : IDeviceService
{
private readonly ICoreService _coreService;
+1 -1
View File
@@ -10,7 +10,7 @@ using Serilog;
namespace Artemis.Core.Services
{
public class ModuleService : IModuleService
internal class ModuleService : IModuleService
{
private readonly ILogger _logger;
private readonly IModuleRepository _moduleRepository;
+2 -2
View File
@@ -26,7 +26,7 @@ namespace Artemis.Core.Services
/// <summary>
/// Provides access to plugin loading and unloading
/// </summary>
public class PluginService : IPluginService
internal class PluginService : IPluginService
{
private readonly IKernel _kernel;
private readonly ILogger _logger;
@@ -34,7 +34,7 @@ namespace Artemis.Core.Services
private readonly List<PluginInfo> _plugins;
private IKernel _childKernel;
internal PluginService(IKernel kernel, ILogger logger, IPluginRepository pluginRepository)
public PluginService(IKernel kernel, ILogger logger, IPluginRepository pluginRepository)
{
_kernel = kernel;
_logger = logger;
@@ -15,7 +15,7 @@ using Serilog;
namespace Artemis.Core.Services
{
public class RenderElementService : IRenderElementService
internal class RenderElementService : IRenderElementService
{
private readonly IKernel _kernel;
private readonly ILogger _logger;
+2 -2
View File
@@ -14,7 +14,7 @@ namespace Artemis.Core.Services
/// <summary>
/// Provides wrapped access the RGB.NET
/// </summary>
public class RgbService : IRgbService, IDisposable
internal class RgbService : IRgbService, IDisposable
{
private readonly List<IRGBDevice> _loadedDevices;
private readonly ILogger _logger;
@@ -23,7 +23,7 @@ namespace Artemis.Core.Services
private readonly PluginSetting<int> _targetFrameRateSetting;
private ListLedGroup _surfaceLedGroup;
internal RgbService(ILogger logger, ISettingsService settingsService)
public RgbService(ILogger logger, ISettingsService settingsService)
{
_logger = logger;
_renderScaleSetting = settingsService.GetSetting("Core.RenderScale", 0.5);
+8 -1
View File
@@ -5,7 +5,7 @@ using Artemis.Storage.Repositories.Interfaces;
namespace Artemis.Core.Services
{
/// <inheritdoc />
public class SettingsService : ISettingsService
internal class SettingsService : ISettingsService
{
private readonly PluginSettings _pluginSettings;
@@ -26,6 +26,13 @@ namespace Artemis.Core.Services
/// </summary>
public interface ISettingsService : IProtectedArtemisService
{
/// <summary>
/// Gets the setting with the provided name. If the setting does not exist yet, it is created.
/// </summary>
/// <typeparam name="T">The type of the setting, can be any serializable type</typeparam>
/// <param name="name">The name of the setting</param>
/// <param name="defaultValue">The default value to use if the setting does not exist yet</param>
/// <returns></returns>
PluginSetting<T> GetSetting<T>(string name, T defaultValue = default);
}
}
@@ -17,7 +17,7 @@ using Serilog;
namespace Artemis.Core.Services.Storage
{
public class ProfileService : IProfileService
internal class ProfileService : IProfileService
{
private readonly ILogger _logger;
private readonly IPluginService _pluginService;
@@ -59,7 +59,8 @@ namespace Artemis.Core.Services.Storage
public void ActivateLastProfile(ProfileModule profileModule)
{
var activeProfile = GetLastActiveProfile(profileModule);
ActivateProfile(activeProfile);
if (activeProfile != null)
ActivateProfile(activeProfile);
}
public Profile ActivateProfile(ProfileDescriptor profileDescriptor)