Layer brushes - Make enable-disable process consistent with plugins

This commit is contained in:
SpoinkyNL committed 2020-06-07 15:00:40 +02:00
1 parent a1c2e4ad5a
commit ee37c3b836
37 files changed
+325 -128

No files matched your search

+17
View File
@@ -408,6 +408,23 @@ namespace Artemis.Core.Models.Profile
CalculateRenderProperties();
}
internal void Deactivate()
{
DeactivateLayerBrush();
}
internal void DeactivateLayerBrush()
{
if (LayerBrush == null)
return;
var brush = LayerBrush;
LayerBrush = null;
brush.Dispose();
LayerEntity.PropertyEntities.RemoveAll(p => p.PluginGuid == brush.PluginInfo.Guid);
}
internal void PopulateLeds(ArtemisSurface surface)
{
var leds = new List<ArtemisLed>();
+5 -1
View File
@@ -129,7 +129,11 @@ namespace Artemis.Core.Models.Profile
{
lock (this)
{
if (!IsActivated) return;
if (!IsActivated)
return;
foreach (var layer in GetAllLayers())
layer.Deactivate();
IsActivated = false;
OnDeactivated();