Пример #1
0
 internal static PsComplianceRulePredicateBase FromEnginePredicate(PredicateCondition predicate)
 {
     if (predicate is GreaterThanOrEqualPredicate && predicate.Property.Name.Equals("Item.WhenCreated"))
     {
         return(PsContentDateFromPredicate.FromEnginePredicate(predicate as GreaterThanOrEqualPredicate));
     }
     if (predicate is LessThanOrEqualPredicate && predicate.Property.Name.Equals("Item.WhenCreated"))
     {
         return(PsContentDateToPredicate.FromEnginePredicate(predicate as LessThanOrEqualPredicate));
     }
     if (predicate is TextQueryPredicate)
     {
         return(PsContentMatchQueryPredicate.FromEnginePredicate(predicate as TextQueryPredicate));
     }
     if (predicate is EqualPredicate && predicate.Property.Name.Equals("Item.AccessScope"))
     {
         return(PsAccessScopeIsPredicate.FromEnginePredicate(predicate as EqualPredicate));
     }
     if (predicate is ContentContainsSensitiveInformationPredicate)
     {
         return(PsContentContainsSensitiveInformationPredicate.FromEnginePredicate(predicate as ContentContainsSensitiveInformationPredicate));
     }
     if (predicate is ContentMetadataContainsPredicate)
     {
         return(PsContentPropertyContainsWordsPredicate.FromEnginePredicate(predicate as ContentMetadataContainsPredicate));
     }
     throw new UnexpectedConditionOrActionDetectedException();
 }
Пример #2
0
 private void SetTaskConditions(IEnumerable <PsComplianceRulePredicateBase> conditions)
 {
     foreach (PsComplianceRulePredicateBase psComplianceRulePredicateBase in conditions)
     {
         if (psComplianceRulePredicateBase is PsAccessScopeIsPredicate)
         {
             this.AccessScopeIs = new AccessScope?((psComplianceRulePredicateBase as PsAccessScopeIsPredicate).PropertyValue);
         }
         else if (psComplianceRulePredicateBase is PsContentContainsSensitiveInformationPredicate)
         {
             PsContentContainsSensitiveInformationPredicate psContentContainsSensitiveInformationPredicate = psComplianceRulePredicateBase as PsContentContainsSensitiveInformationPredicate;
             this.ContentContainsSensitiveInformation = psContentContainsSensitiveInformationPredicate.DataClassifications;
         }
         else
         {
             if (!(psComplianceRulePredicateBase is PsContentPropertyContainsWordsPredicate))
             {
                 throw new UnexpectedConditionOrActionDetectedException();
             }
             PsContentPropertyContainsWordsPredicate psContentPropertyContainsWordsPredicate = psComplianceRulePredicateBase as PsContentPropertyContainsWordsPredicate;
             this.ContentPropertyContainsWords = psContentPropertyContainsWordsPredicate.Words;
         }
     }
 }