Exemplo n.º 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();
 }
Exemplo n.º 2
0
 private void SetTaskConditions(IEnumerable <PsComplianceRulePredicateBase> conditions)
 {
     foreach (PsComplianceRulePredicateBase psComplianceRulePredicateBase in conditions)
     {
         if (psComplianceRulePredicateBase is PsContentMatchQueryPredicate)
         {
             base.ContentMatchQuery = (psComplianceRulePredicateBase as PsContentMatchQueryPredicate).TextQuery;
         }
         else if (psComplianceRulePredicateBase is PsContentDateFromPredicate)
         {
             PsContentDateFromPredicate psContentDateFromPredicate = psComplianceRulePredicateBase as PsContentDateFromPredicate;
             this.ContentDateFrom = new DateTime?(psContentDateFromPredicate.PropertyValue);
         }
         else
         {
             if (!(psComplianceRulePredicateBase is PsContentDateToPredicate))
             {
                 throw new UnexpectedConditionOrActionDetectedException();
             }
             PsContentDateToPredicate psContentDateToPredicate = psComplianceRulePredicateBase as PsContentDateToPredicate;
             this.ContentDateTo = new DateTime?(psContentDateToPredicate.PropertyValue);
         }
     }
 }