[Herald+Core] Send notifications to plugins during read-all in Debug (#136)

This will allow notifications to be sent to Notification listeners during read-all to enhance testability.

This is controlled by the `DEBUG` compiler directive, so Release versions will not have this behaviour.

However, Herald, being a plugin itself, should ignore these otherwise the results are.... unfortunate. #askmehowiknow
This commit is contained in:
F K 2024-01-29 15:36:03 -05:00 committed by GitHub
commit a555c86083
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 0 deletions

View file

@ -46,13 +46,22 @@ namespace Observatory.PluginManagement
{
var guid = Guid.Empty;
#if DEBUG // For exercising testing notifier plugins in read-all
if (notificationArgs.Rendering.HasFlag(NotificationRendering.PluginNotifier))
{
var handler = Notification;
handler?.Invoke(this, notificationArgs);
}
#endif
if (!IsLogMonitorBatchReading)
{
#if !DEBUG
if (notificationArgs.Rendering.HasFlag(NotificationRendering.PluginNotifier))
{
var handler = Notification;
handler?.Invoke(this, notificationArgs);
}
#endif
if (!OverridePopup && Properties.Core.Default.NativeNotify && notificationArgs.Rendering.HasFlag(NotificationRendering.NativeVisual))
{