mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Code cleanup
This commit is contained in:
1 parent
0c245ba83d
commit
ae330c3769
73 files changed
+372
-364
No files matched your search
@@ -42,14 +42,6 @@ namespace Artemis.Core.Services
|
||||
Task.Run(Initialize);
|
||||
}
|
||||
|
||||
private void ConfigureJsonConvert()
|
||||
{
|
||||
JsonConvert.DefaultSettings = () => new JsonSerializerSettings
|
||||
{
|
||||
Converters = new List<JsonConverter> { new SKColorConverter() }
|
||||
};
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Dispose services
|
||||
@@ -58,6 +50,14 @@ namespace Artemis.Core.Services
|
||||
|
||||
public bool IsInitialized { get; set; }
|
||||
|
||||
private void ConfigureJsonConvert()
|
||||
{
|
||||
JsonConvert.DefaultSettings = () => new JsonSerializerSettings
|
||||
{
|
||||
Converters = new List<JsonConverter> {new SKColorConverter()}
|
||||
};
|
||||
}
|
||||
|
||||
private async Task Initialize()
|
||||
{
|
||||
if (IsInitialized)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Artemis.Core.Models.Profile;
|
||||
using Artemis.Core.Models.Profile.KeyframeEngines;
|
||||
using Artemis.Core.Models.Profile.LayerProperties;
|
||||
@@ -61,9 +60,7 @@ namespace Artemis.Core.Services
|
||||
}
|
||||
// If no settings found, provide a fresh instance of the settings type
|
||||
else if (settingsType != null)
|
||||
{
|
||||
settingsInstance = Activator.CreateInstance(settingsType);
|
||||
}
|
||||
|
||||
var arguments = new IParameter[]
|
||||
{
|
||||
@@ -72,7 +69,7 @@ namespace Artemis.Core.Services
|
||||
new ConstructorArgument("descriptor", brushDescriptor)
|
||||
};
|
||||
var layerElement = (LayerBrush) _kernel.Get(brushDescriptor.LayerBrushType, arguments);
|
||||
layer.LayerBrush = (layerElement);
|
||||
layer.LayerBrush = layerElement;
|
||||
|
||||
return layerElement;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Artemis.Core.Services
|
||||
_pluginSettings = new PluginSettings(pluginInfo, pluginSettingRepository);
|
||||
}
|
||||
|
||||
public PluginSetting<T> GetSetting<T>(string name, T defaultValue = default(T))
|
||||
public PluginSetting<T> GetSetting<T>(string name, T defaultValue = default)
|
||||
{
|
||||
return _pluginSettings.GetSetting(name, defaultValue);
|
||||
}
|
||||
@@ -28,6 +28,6 @@ namespace Artemis.Core.Services
|
||||
/// </summary>
|
||||
public interface ISettingsService : IProtectedArtemisService
|
||||
{
|
||||
PluginSetting<T> GetSetting<T>(string name, T defaultValue = default(T));
|
||||
PluginSetting<T> GetSetting<T>(string name, T defaultValue = default);
|
||||
}
|
||||
}
|
||||
@@ -160,9 +160,7 @@ namespace Artemis.Core.Services.Storage
|
||||
{
|
||||
// Only instantiate engines for properties without an existing engine instance
|
||||
foreach (var layerProperty in profile.GetAllLayers().SelectMany(l => l.Properties).Where(p => p.KeyframeEngine == null))
|
||||
{
|
||||
_layerService.InstantiateKeyframeEngine(layerProperty);
|
||||
}
|
||||
}
|
||||
|
||||
private void ActiveProfilesPopulateLeds(ArtemisSurface surface)
|
||||
|
||||
Reference in new issue
Block a user