Method Create
- Namespace
- MailFathom.Application.Rules
- Assembly
- MailFathom.Application.dll
Create(string, IMailRuleCondition, MailRuleActionSet?, bool, IReadOnlyList<string>?, IReadOnlyList<MailRuleTrigger>?, JobRecurrence?)
Creates a rule from a condition that has already been proven usable.
public static MailRule Create(string name, IMailRuleCondition condition, MailRuleActionSet? actions = null, bool stopWhenMatched = false, IReadOnlyList<string>? accounts = null, IReadOnlyList<MailRuleTrigger>? triggers = null, JobRecurrence? schedule = null)
Parameters
namestringThe name the rule is declared and reported under.
conditionIMailRuleConditionThe compiled condition.
actionsMailRuleActionSetWhat a match does to the matching email, or nothing for a rule that changes nothing.
stopWhenMatchedboolWhether a match ends the pass.
accountsIReadOnlyList<string>The accounts the rule applies to, or nothing for a rule that applies to every account.
triggersIReadOnlyList<MailRuleTrigger>The automatic triggers the rule takes part in, or nothing for a rule only a requested walk runs. An empty list and null say the same thing, because a rule takes part in the occasions it names and in no others.
scheduleJobRecurrenceThe occasions a scheduled walk happens on, required by and only by the schedule trigger.
Returns
- MailRule
The rule.
Exceptions
- ArgumentNullException
Thrown when
conditionis null.- ArgumentException
Thrown when
nameis empty or whitespace, an account is, a trigger is unspecified, or the schedule and the trigger that uses it do not agree.