Sidebar - Show message when profile is broken

Events - Keep the old event type around for if you change your mind
This commit is contained in:
Robert committed 2021-09-18 13:38:09 +02:00
1 parent d6372dffad
commit 02f4609eae
8 files changed
+78 -27

No files matched your search

@@ -377,7 +377,7 @@ namespace Artemis.Core
public ICondition? DisplayCondition
{
get => _displayCondition;
private set => SetAndNotify(ref _displayCondition, value);
set => SetAndNotify(ref _displayCondition, value);
}
private ICondition? _displayCondition;
@@ -404,21 +404,6 @@ namespace Artemis.Core
DisplayConditionMet = DisplayCondition.IsMet;
}
/// <summary>
/// Replaces the current <see cref="DisplayCondition" /> with the provided <paramref name="condition" /> or
/// <see langword="null" />
/// </summary>
/// <param name="condition">The condition to change the <see cref="DisplayCondition" /> to</param>
public void ChangeDisplayCondition(ICondition? condition)
{
if (condition == DisplayCondition)
return;
ICondition? old = DisplayCondition;
DisplayCondition = condition;
old?.Dispose();
}
#endregion
}
}
@@ -327,7 +327,17 @@ namespace Artemis.Core.Services
if (profileConfiguration.Profile != null)
return profileConfiguration.Profile;
ProfileEntity profileEntity = _profileRepository.Get(profileConfiguration.Entity.ProfileId);
ProfileEntity profileEntity;
try
{
profileEntity = _profileRepository.Get(profileConfiguration.Entity.ProfileId);
}
catch (Exception e)
{
profileConfiguration.SetBrokenState("Failed to activate profile", e);
throw;
}
if (profileEntity == null)
throw new ArtemisCoreException($"Cannot find profile named: {profileConfiguration.Name} ID: {profileConfiguration.Entity.ProfileId}");