diff --git a/ObservatoryCore/PluginManagement/PluginCore.cs b/ObservatoryCore/PluginManagement/PluginCore.cs
index 3da0cb8..90f119b 100644
--- a/ObservatoryCore/PluginManagement/PluginCore.cs
+++ b/ObservatoryCore/PluginManagement/PluginCore.cs
@@ -36,15 +36,18 @@ namespace Observatory.PluginManagement
if (!LogMonitor.GetInstance.ReadAllInProgress())
{
- var handler = Notification;
- handler?.Invoke(this, notificationArgs);
+ if (notificationArgs.Rendering.HasFlag(NotificationRendering.PluginNotifier))
+ {
+ var handler = Notification;
+ handler?.Invoke(this, notificationArgs);
+ }
- if (Properties.Core.Default.NativeNotify)
+ if (Properties.Core.Default.NativeNotify && notificationArgs.Rendering.HasFlag(NotificationRendering.NativeVisual))
{
guid = NativePopup.InvokeNativeNotification(notificationArgs);
}
- if (Properties.Core.Default.VoiceNotify)
+ if (Properties.Core.Default.VoiceNotify && notificationArgs.Rendering.HasFlag(NotificationRendering.NativeVocal))
{
NativeVoice.EnqueueAndAnnounce(notificationArgs);
}
@@ -60,7 +63,23 @@ namespace Observatory.PluginManagement
public void UpdateNotification(Guid id, NotificationArgs notificationArgs)
{
- NativePopup.UpdateNotification(id, notificationArgs);
+ if (!LogMonitor.GetInstance.ReadAllInProgress())
+ {
+
+ if (notificationArgs.Rendering.HasFlag(NotificationRendering.PluginNotifier))
+ {
+ var handler = Notification;
+ handler?.Invoke(this, notificationArgs);
+ }
+
+ if (notificationArgs.Rendering.HasFlag(NotificationRendering.NativeVisual))
+ NativePopup.UpdateNotification(id, notificationArgs);
+
+ if (Properties.Core.Default.VoiceNotify && notificationArgs.Rendering.HasFlag(NotificationRendering.NativeVocal))
+ {
+ NativeVoice.EnqueueAndAnnounce(notificationArgs);
+ }
+ }
}
///
diff --git a/ObservatoryFramework/EventArgs.cs b/ObservatoryFramework/EventArgs.cs
index ea48664..c0e3064 100644
--- a/ObservatoryFramework/EventArgs.cs
+++ b/ObservatoryFramework/EventArgs.cs
@@ -54,5 +54,19 @@ namespace Observatory.Framework
/// Specify window Y position as a percentage from upper left corner (overrides Core setting). Default -1.0 (use Core setting).
///
public double YPos = -1.0;
+ ///
+ /// Specifies the desired renderings of the notification.
+ ///
+ public NotificationRendering Rendering = NotificationRendering.All;
+ }
+
+ [Flags]
+ public enum NotificationRendering
+ {
+ // These need to be multiples of 2 as they're used via masking.
+ NativeVisual = 1,
+ NativeVocal = 2,
+ PluginNotifier = 4,
+ All = (NativeVisual | NativeVocal | PluginNotifier)
}
}