Esempio n. 1
0
        private IEnumerable <ActionInvocation> CreateInvocations(IExecutionContext executionContext, IActionContext actionContext)
        {
            ICompiledRule compiledRule = actionContext.CompiledRule;
            MatchTrigger  trigger      = actionContext.Activation.Trigger;
            var           invocations  = new List <ActionInvocation>();

            foreach (IRuleAction action in compiledRule.Actions)
            {
                if (!trigger.Matches(action.Trigger))
                {
                    continue;
                }

                var invocation = new ActionInvocation(executionContext, actionContext, action);
                invocations.Add(invocation);
            }
            return(invocations);
        }
Esempio n. 2
0
 public static bool Matches(this MatchTrigger matchTrigger, ActionTrigger actionTrigger)
 {
     return(((int)actionTrigger & (int)matchTrigger) != 0);
 }