mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Implemented layer LED assignment
Added a centralised ProfileEditorSurface for communication between VMs Prefixed Surface, Device and Led with Artemis to differentiate them better
This commit is contained in:
1 parent
c7a5532c34
commit
16decaae42
50 files changed
+556
-662
No files matched your search
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using Artemis.Core.Models.Profile;
|
||||
using Artemis.Core.Models.Profile.Abstract;
|
||||
|
||||
namespace Artemis.UI.Services.Interfaces
|
||||
{
|
||||
public interface IProfileEditorService : IArtemisUIService
|
||||
{
|
||||
Profile SelectedProfile { get; }
|
||||
ProfileElement SelectedProfileElement { get; }
|
||||
|
||||
void ChangeSelectedProfile(Profile profile);
|
||||
void UpdateSelectedProfile();
|
||||
void ChangeSelectedProfileElement(ProfileElement profileElement);
|
||||
void UpdateSelectedProfileElement();
|
||||
|
||||
event EventHandler SelectedProfileChanged;
|
||||
event EventHandler SelectedProfileUpdated;
|
||||
event EventHandler SelectedProfileElementChanged;
|
||||
event EventHandler SelectedProfileElementUpdated;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using Artemis.Core.Models.Profile;
|
||||
using Artemis.Core.Models.Profile.Abstract;
|
||||
using Artemis.Core.Services.Storage.Interfaces;
|
||||
using Artemis.UI.Services.Interfaces;
|
||||
|
||||
namespace Artemis.UI.Services
|
||||
{
|
||||
public class ProfileEditorService : IProfileEditorService
|
||||
{
|
||||
private readonly IProfileService _profileService;
|
||||
|
||||
public ProfileEditorService(IProfileService profileService)
|
||||
{
|
||||
_profileService = profileService;
|
||||
}
|
||||
|
||||
public Profile SelectedProfile { get; private set; }
|
||||
public ProfileElement SelectedProfileElement { get; private set; }
|
||||
|
||||
public void ChangeSelectedProfile(Profile profile)
|
||||
{
|
||||
SelectedProfile = profile;
|
||||
OnSelectedProfileChanged();
|
||||
}
|
||||
|
||||
public void UpdateSelectedProfile()
|
||||
{
|
||||
_profileService.UpdateProfile(SelectedProfile, false);
|
||||
OnSelectedProfileElementUpdated();
|
||||
}
|
||||
|
||||
public void ChangeSelectedProfileElement(ProfileElement profileElement)
|
||||
{
|
||||
SelectedProfileElement = profileElement;
|
||||
OnSelectedProfileElementChanged();
|
||||
}
|
||||
|
||||
public void UpdateSelectedProfileElement()
|
||||
{
|
||||
_profileService.UpdateProfile(SelectedProfile, true);
|
||||
OnSelectedProfileElementUpdated();
|
||||
}
|
||||
|
||||
public event EventHandler SelectedProfileChanged;
|
||||
public event EventHandler SelectedProfileUpdated;
|
||||
public event EventHandler SelectedProfileElementChanged;
|
||||
public event EventHandler SelectedProfileElementUpdated;
|
||||
|
||||
protected virtual void OnSelectedProfileElementUpdated()
|
||||
{
|
||||
SelectedProfileElementUpdated?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
protected virtual void OnSelectedProfileElementChanged()
|
||||
{
|
||||
SelectedProfileElementChanged?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
protected virtual void OnSelectedProfileUpdated()
|
||||
{
|
||||
SelectedProfileUpdated?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
protected virtual void OnSelectedProfileChanged()
|
||||
{
|
||||
SelectedProfileChanged?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user