Plugin settings - Added SettingSaved event

Meta - Tweak R# ruleset
This commit is contained in:
SpoinkyNL committed 2020-10-13 00:01:04 +02:00
1 parent 17d41647b6
commit ced30d3538
2 files changed
+16 -1

No files matched your search

@@ -88,12 +88,18 @@ namespace Artemis.Core
_pluginSettingEntity.Value = JsonConvert.SerializeObject(Value);
_pluginRepository.SaveSetting(_pluginSettingEntity);
OnSettingSaved();
}
/// <summary>
/// Occurs when the value of the setting has been changed
/// </summary>
public event EventHandler<EventArgs> SettingChanged;
public event EventHandler SettingChanged;
/// <summary>
/// Occurs when the value of the setting has been saved
/// </summary>
public event EventHandler SettingSaved;
/// <inheritdoc />
public override string ToString()
@@ -108,5 +114,13 @@ namespace Artemis.Core
{
SettingChanged?.Invoke(this, EventArgs.Empty);
}
/// <summary>
/// Invokes the <see cref="OnSettingSaved" /> event
/// </summary>
protected internal virtual void OnSettingSaved()
{
SettingSaved?.Invoke(this, EventArgs.Empty);
}
}
}