Table of Contents

Class NotificationSettings

Namespace
McServerLauncher.Models
Assembly
McServerLauncher.dll

Which notifications are enabled, for a given scope. Used both globally (default for every server, in AppSettings) and per-server (an override, in ServerConfig). Enabled is the master switch for the scope; the per-kind flags are only consulted when it's on.

public class NotificationSettings : ObservableObject, INotifyPropertyChanged, INotifyPropertyChanging
Inheritance
NotificationSettings
Implements
Inherited Members

Remarks

Observable for the same reason ServerConfig is: the per-server override is reached through ServerConfig.Notifications and bound straight into the edit dialog by a nested path, so a plain object here would leave those eight checkboxes unable to show a change that did not come from the user clicking them.

Properties

AutoRestartGaveUp

[ExcludeFromCodeCoverage]
public bool AutoRestartGaveUp { get; set; }

Property Value

bool

ColorError

Colour for notifications that report something broken.

[ExcludeFromCodeCoverage]
public string ColorError { get; set; }

Property Value

string

ColorInfo

Colour for notifications that are neither good nor bad.

[ExcludeFromCodeCoverage]
public string ColorInfo { get; set; }

Property Value

string

ColorSuccess

Colour for notifications that report something going right.

[ExcludeFromCodeCoverage]
public string ColorSuccess { get; set; }

Property Value

string

ColorWarning

Colour for notifications worth knowing about.

[ExcludeFromCodeCoverage]
public string ColorWarning { get; set; }

Property Value

string

Enabled

Master switch for this scope. When false, nothing is shown.

[ExcludeFromCodeCoverage]
public bool Enabled { get; set; }

Property Value

bool

IdleShutdown

[ExcludeFromCodeCoverage]
public bool IdleShutdown { get; set; }

Property Value

bool

PlayerDeath

[ExcludeFromCodeCoverage]
public bool PlayerDeath { get; set; }

Property Value

bool

PlayerJoined

[ExcludeFromCodeCoverage]
public bool PlayerJoined { get; set; }

Property Value

bool

PlayerLeft

[ExcludeFromCodeCoverage]
public bool PlayerLeft { get; set; }

Property Value

bool

ServerCrashed

[ExcludeFromCodeCoverage]
public bool ServerCrashed { get; set; }

Property Value

bool

WokeOnDemand

[ExcludeFromCodeCoverage]
public bool WokeOnDemand { get; set; }

Property Value

bool

Methods

Allows(NotificationKind)

True if this scope allows kind (master on AND that kind on).

public bool Allows(NotificationKind kind)

Parameters

kind NotificationKind

Returns

bool

Clone()

A copy (used to seed a per-server override from the global defaults). Copied field-by-field on purpose: if a reference-typed field is ever added here, a MemberwiseClone would silently share it between the global and per-server copies — this makes each field an explicit choice.

public NotificationSettings Clone()

Returns

NotificationSettings

ColorFor(NotificationLevel)

The configured colour for a level, as a hex string.

public string ColorFor(NotificationLevel level)

Parameters

level NotificationLevel

Returns

string

SetColorFor(NotificationLevel, string)

Sets the colour for a level. Used by the settings dialog.

public void SetColorFor(NotificationLevel level, string hex)

Parameters

level NotificationLevel
hex string