Table of Contents

Struct MailRuleTrigger

Namespace
MailFathom.Application.Rules
Assembly
MailFathom.Application.dll

Names one automatic occasion on which a rule takes part in a pass.

[JsonConverter(typeof(MailRuleTriggerJsonConverter))]
public readonly record struct MailRuleTrigger : IEquatable<MailRuleTrigger>
Implements
Inherited Members

Remarks

A closed enumeration rather than a C# enum, because the name is the identity: it is what an operator writes under a rule's Triggers key and the form a rule set's revision is derived from. An enum member's ordinal would mean nothing outside this assembly, and its member name would change with a rename that the configuration surface and the derived identity both have to survive.

Two members, and the set is closed rather than final: a third occasion is a member to append. What is deliberately not a member is a run somebody asked for. That is the request itself rather than an occasion a rule opts into, so it reaches every rule of the set; MailRuleReach is where the two are told apart.

Being a struct, default is reachable and names no trigger. IsSpecified reports that, TryParseName(string?, out MailRuleTrigger) never produces one, and Create(string, IMailRuleCondition, MailRuleActionSet?, bool, IReadOnlyList<string>?, IReadOnlyList<MailRuleTrigger>?, JobRecurrence?) refuses one.

Properties

All

Gets every trigger a rule may declare.

Arrival

Gets the trigger that runs a rule over a message the account's synchronization run has just committed.

IsSpecified

Gets whether this value names a trigger rather than the unusable struct default.

Name

Gets the name the trigger is declared and reported under.

Schedule

Gets the trigger that runs a rule over the account's whole mailbox when a declared occasion has passed.

Methods

ToString()

Returns the fully qualified type name of this instance.

TryParseName(string?, out MailRuleTrigger)

Parses a declared name back into the trigger it names.