Exemple #1
0
        internal static IEnumerable <PsComplianceRulePredicateBase> ConvertEngineConditionToTaskConditions(Microsoft.Office.CompliancePolicy.PolicyEvaluation.Condition condition)
        {
            List <PsComplianceRulePredicateBase> list = new List <PsComplianceRulePredicateBase>();
            QueryPredicate queryPredicate             = condition as QueryPredicate;

            if (queryPredicate != null)
            {
                AndCondition andCondition = queryPredicate.SubCondition as AndCondition;
                if (andCondition == null)
                {
                    return(list);
                }
                using (List <Microsoft.Office.CompliancePolicy.PolicyEvaluation.Condition> .Enumerator enumerator = andCondition.SubConditions.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        Microsoft.Office.CompliancePolicy.PolicyEvaluation.Condition condition2 = enumerator.Current;
                        list.AddRange(PsHoldRule.ConvertEngineConditionToTaskConditions(condition2));
                    }
                    return(list);
                }
            }
            if (condition is PredicateCondition)
            {
                PredicateCondition predicate = condition as PredicateCondition;
                list.Add(PsComplianceRulePredicateBase.FromEnginePredicate(predicate));
            }
            else if (!(condition is TrueCondition))
            {
                throw new UnexpectedConditionOrActionDetectedException();
            }
            return(list);
        }
        internal static IEnumerable <PsComplianceRulePredicateBase> ConvertEngineConditionToTaskConditions(Microsoft.Office.CompliancePolicy.PolicyEvaluation.Condition condition)
        {
            List <PsComplianceRulePredicateBase> list = new List <PsComplianceRulePredicateBase>();

            if (condition is AndCondition)
            {
                AndCondition andCondition = condition as AndCondition;
                using (List <Microsoft.Office.CompliancePolicy.PolicyEvaluation.Condition> .Enumerator enumerator = andCondition.SubConditions.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        Microsoft.Office.CompliancePolicy.PolicyEvaluation.Condition condition2 = enumerator.Current;
                        if (condition2 is PredicateCondition)
                        {
                            list.Add(PsComplianceRulePredicateBase.FromEnginePredicate(condition2 as PredicateCondition));
                        }
                        else if (!(condition2 is TrueCondition))
                        {
                            throw new UnexpectedConditionOrActionDetectedException();
                        }
                    }
                    return(list);
                }
            }
            throw new UnexpectedConditionOrActionDetectedException();
        }
        internal IEnumerable <Microsoft.Office.CompliancePolicy.PolicyEvaluation.Condition> ConvertEngineConditionToTaskConditions(Microsoft.Office.CompliancePolicy.PolicyEvaluation.Condition condition)
        {
            AndCondition andCondition = condition as AndCondition;

            if (andCondition == null)
            {
                return(Enumerable.Empty <Microsoft.Office.CompliancePolicy.PolicyEvaluation.Condition>());
            }
            return(andCondition.SubConditions);
        }