Adaption hints - Added single LED adaption hint

Adaption hints - Added more sections to keyboard section adaption hint
This commit is contained in:
Robert committed 2023-09-10 11:58:37 +02:00
1 parent ca9ce948c5
commit d96581f11c
21 files changed
+433 -62

No files matched your search

@@ -8,7 +8,7 @@
<ComboBox x:Name="ChildEnumComboBox" HorizontalAlignment="Stretch">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="local:EnumComboBoxItem">
<TextBlock Text="{CompiledBinding Value}" />
<TextBlock Text="{CompiledBinding Description}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
@@ -0,0 +1,45 @@
using System.Collections.Generic;
using Artemis.Core;
namespace Artemis.UI.Shared.Services.ProfileEditor.Commands;
/// <summary>
/// Represents a profile editor command that can be used to apply adaption hints to a layer.
/// </summary>
public class ApplyAdaptionHints : IProfileEditorCommand
{
private readonly Layer _layer;
private readonly List<ArtemisDevice> _devices;
private readonly List<ArtemisLed> _originalLeds;
/// <summary>
/// Creates a new instance of the <see cref="ApplyAdaptionHints" /> class.
/// </summary>
public ApplyAdaptionHints(Layer layer, List<ArtemisDevice> devices)
{
_layer = layer;
_devices = devices;
_originalLeds = new List<ArtemisLed>(_layer.Leds);
}
#region Implementation of IProfileEditorCommand
/// <inheritdoc />
public string DisplayName => "Apply adaption hints";
/// <inheritdoc />
public void Execute()
{
_layer.ClearLeds();
_layer.Adapter.Adapt(_devices);
}
/// <inheritdoc />
public void Undo()
{
_layer.ClearLeds();
_layer.AddLeds(_originalLeds);
}
#endregion
}