Struct ClientThemeChoice
- Namespace
- MailFathom.Application.Preferences
- Assembly
- MailFathom.Application.dll
What a person chose the client to be painted in: one of the two themes, or whatever their machine is set to.
[JsonConverter(typeof(ClientThemeChoiceJsonConverter))]
public readonly record struct ClientThemeChoice : IEquatable<ClientThemeChoice>
- Implements
- Inherited Members
Remarks
A closed enumeration rather than a C# enum because the name travels both ways across the client endpoint and is stored as itself: it is what a preferences read answers with, what a write states, and what the persisted document holds. A member rename must not change any of the three, and an ordinal would mean nothing to the client reading the response.
The set is the client's own rather than a second opinion beside it. theme/themeChoice.ts offers exactly
these three, so a name this build does not publish is one no client could have chosen, and it is refused at the
boundary rather than stored for a screen that could not render it.
Being a struct, default is reachable and is not a choice. It reports itself through IsSpecified, refuses to answer for a name, and is rejected by the converter below, so nothing undeclared reaches a response or the stored document.
Properties
- All
Gets every choice this build publishes.
- Dark
Gets the choice to paint the client dark whatever the machine is set to.
- IsSpecified
Gets whether this value names a published choice rather than the unusable struct default.
- Light
Gets the choice to paint the client light whatever the machine is set to.
- Name
Gets the published name, which is what a client reads and what the stored document holds.
- System
Gets the choice to follow whatever appearance the machine in front of the person is set to.
Methods
- ToString()
Returns the fully qualified type name of this instance.
- TryParse(string?, out ClientThemeChoice)
Reports the choice by its published name.