protected override RuleCollection ParseRules(IEnumerable <TransportRule> adTransportRules, RuleHealthMonitor ruleHealthMonitor)
        {
            RuleCollection ruleCollection  = base.ParseRules(adTransportRules, ruleHealthMonitor);
            RuleCollection ruleCollection2 = new RuleCollection(ruleCollection.Name);

            foreach (Rule rule in ruleCollection)
            {
                PolicyTipRule policyTipRule = (PolicyTipRule)rule;
                foreach (Microsoft.Exchange.MessagingPolicies.Rules.Action action in policyTipRule.Actions)
                {
                    if (action is SenderNotify)
                    {
                        if (policyTipRule.ForkConditions != null && policyTipRule.ForkConditions.Count > 0)
                        {
                            AndCondition andCondition = new AndCondition();
                            foreach (Condition item in policyTipRule.ForkConditions)
                            {
                                andCondition.SubConditions.Add(item);
                            }
                            andCondition.SubConditions.Add(policyTipRule.Condition);
                            policyTipRule.Condition      = andCondition;
                            policyTipRule.ForkConditions = null;
                        }
                        ruleCollection2.Add(policyTipRule);
                        break;
                    }
                }
            }
            return(ruleCollection2);
        }
Пример #2
0
        protected override ExecutionControl EnterRule()
        {
            OwaRulesEvaluationContext owaRulesEvaluationContext = (OwaRulesEvaluationContext)base.Context;
            PolicyTipRule             policyTipRule             = (PolicyTipRule)owaRulesEvaluationContext.CurrentRule;

            if (owaRulesEvaluationContext.RuleExecutionMonitor != null)
            {
                owaRulesEvaluationContext.RuleExecutionMonitor.RuleId = policyTipRule.ImmutableId.ToString("D");
                owaRulesEvaluationContext.RuleExecutionMonitor.Restart();
            }
            owaRulesEvaluationContext.ResetPerRuleData();
            return(base.EnterRule());
        }
Пример #3
0
        protected override void CreateRuleSubElements(Rule rule, XmlReader reader, RulesCreationContext creationContext)
        {
            PolicyTipRule    policyTipRule = (PolicyTipRule)rule;
            List <Condition> list          = new List <Condition>();

            while (base.IsTag(reader, "fork"))
            {
                list.Add(this.ParseFork(reader, creationContext));
                base.ReadNext(reader);
            }
            if (list.Count > 0)
            {
                policyTipRule.ForkConditions = list;
            }
        }