Class NotificationPreferences
- Namespace
- McServerLauncher.Services
- Assembly
- McServerLauncher.dll
Decides whether a given notification should be shown for a given server, combining the global
settings with an optional per-server override. Global is app-wide state (like
ToastService.Shared): set once at startup from AppSettings and updated when
the user edits the global notification settings.
public static class NotificationPreferences
- Inheritance
-
NotificationPreferences
- Inherited Members
Properties
Global
Global defaults (the master switch + per-kind flags applied to every server).
public static NotificationSettings Global { get; set; }
Property Value
Methods
EffectiveFor(ServerConfig?)
The settings that actually apply to a server: its own override, or the global ones.
public static NotificationSettings EffectiveFor(ServerConfig? config)
Parameters
configServerConfig
Returns
Remarks
Pulled out of ShouldNotify(ServerConfig, NotificationKind) because the colours need exactly the same answer. Two copies of "which settings apply here" would drift the first time one of them changed, and the symptom would be a server notifying by its own rules and colouring by somebody else's — visible, confusing, and very hard to attribute.
ShouldNotify(ServerConfig, NotificationKind)
True if kind should be shown for config. The global
master switch always wins (turning it off silences everything); otherwise a server using a
custom override is judged by its own settings, and every other server by the global ones.
public static bool ShouldNotify(ServerConfig config, NotificationKind kind)
Parameters
configServerConfigkindNotificationKind