Profile editor - Added profile duplicate

This commit is contained in:
SpoinkyNL committed 2020-12-17 21:34:41 +01:00
1 parent e61a031485
commit 15759c9289
4 files changed
+26 -19

No files matched your search

@@ -9,12 +9,13 @@ namespace Artemis.Core
/// </summary>
public class ProfileDescriptor : CorePropertyChanged
{
private readonly ProfileEntity _profileEntity;
internal ProfileDescriptor(ProfileModule profileModule, ProfileEntity profileEntity)
{
_profileEntity = profileEntity;
ProfileModule = profileModule;
Id = profileEntity.Id;
Name = profileEntity.Name;
IsLastActiveProfile = profileEntity.IsActive;
}
/// <summary>
@@ -25,26 +26,17 @@ namespace Artemis.Core
/// <summary>
/// Gets the unique ID of the profile by which it can be loaded from storage
/// </summary>
public Guid Id => _profileEntity.Id;
public Guid Id { get; }
/// <summary>
/// Gets the name of the profile
/// </summary>
public string Name => _profileEntity.Name;
public string Name { get; }
/// <summary>
/// Gets a boolean indicating whether this was the last active profile
/// </summary>
public bool IsLastActiveProfile => _profileEntity.IsActive;
public bool IsLastActiveProfile { get; }
/// <summary>
/// Triggers a property change for all properties linked to the backing profile entity ¯\_(ツ)_/¯
/// </summary>
public void Update()
{
OnPropertyChanged(nameof(Id));
OnPropertyChanged(nameof(Name));
OnPropertyChanged(nameof(IsLastActiveProfile));
}
}
}