Class MailRuleActionSet
- Namespace
- MailFathom.Application.Rules.Actions
- Assembly
- MailFathom.Application.dll
What one rule does to a matching email, as the actions it declared in the order MailFathom applies them.
public sealed class MailRuleActionSet
- Inheritance
-
MailRuleActionSet
- Inherited Members
Remarks
A set rather than one value, because the ordinary cases are combinations: file it and mark it read, copy it to an archive folder and mark it read. What the set refuses is a combination naming two fates for one occurrence, and it refuses it where the configuration is read rather than resolving it at run time — whichever of two such actions ran second would act on a message that is no longer where the rule matched it, and no resolution invented here would be the one the operator meant.
One rule therefore names at most one fate — relocate, copy, or delete — and a delete admits nothing beside it, since a flag written on a message being removed is a flag nobody will ever read. Everything the table below permits is a flag change beside a relocation or a copy, or a single action on its own.
The order is MailFathom's rather than the order the actions were written in: the flag is written first and the relocation or the delete last, so every permitted combination acts on the occurrence the condition matched. It is fixed here so that it is the same on every run and on every instance.
An empty set is permitted and is not a defect. A rule that declares no action selects mail and nothing more, which is
what a rule ending the pass with StopWhenMatched does to keep the mail it names away from the rules below it.
Properties
- Actions
Gets the actions in the order MailFathom applies them.
- Empty
Gets the set a rule that does nothing to the mail it selects declares.
- IsEmpty
Gets whether the rule asks for no change at all.
Methods
- ApplicationOrderOf(MailRuleAction)
Ranks one action within the fixed order every permitted combination is applied in.
- Create(IReadOnlyList<MailRuleAction>)
Builds the set of actions a rule applies, in the order they are applied.
- FindErrors(string, IReadOnlyList<MailRuleAction>)
Reports every reason the declared actions could not be honored together.
- FindRefusal(IReadOnlyCollection<MailRuleAction>, MailRuleAction)
Reports why one further action cannot join the actions already being applied to one email.