Table of Contents

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

name string

The name the rule is declared and reported under.

condition IMailRuleCondition

The compiled condition.

actions MailRuleActionSet

What a match does to the matching email, or nothing for a rule that changes nothing.

stopWhenMatched bool

Whether a match ends the pass.

accounts IReadOnlyList<string>

The accounts the rule applies to, or nothing for a rule that applies to every account.

triggers IReadOnlyList<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.

schedule JobRecurrence

The occasions a scheduled walk happens on, required by and only by the schedule trigger.

Returns

MailRule

The rule.

Exceptions

ArgumentNullException

Thrown when condition is null.

ArgumentException

Thrown when name is empty or whitespace, an account is, a trigger is unspecified, or the schedule and the trigger that uses it do not agree.