Пример #1
0
        internal static QueryFilter DsIsRodcFilterBuilder(SinglePropertyFilter filter)
        {
            Database.InternalAssertComparisonFilter(filter, NtdsDsaSchema.DsIsRodc);
            ComparisonFilter comparisonFilter = filter as ComparisonFilter;

            return(new ComparisonFilter(comparisonFilter.ComparisonOperator, ADObjectSchema.ObjectCategory, ((bool)comparisonFilter.PropertyValue) ? NtdsDsa.mostDerivedClassForRodc : NtdsDsa.mostDerivedClass));
        }
Пример #2
0
        // Token: 0x06000943 RID: 2371 RVA: 0x00042A34 File Offset: 0x00040C34
        private static bool FailNonContentIndexedSearch(Folder folder, QueryFilter searchFilter)
        {
            if (folder is SearchFolder || folder.Session is PublicFolderSession)
            {
                return(false);
            }
            SinglePropertyFilter singlePropertyFilter = null;

            if (searchFilter is SinglePropertyFilter)
            {
                singlePropertyFilter = (searchFilter as SinglePropertyFilter);
            }
            else
            {
                if (searchFilter is NotFilter)
                {
                    return(FolderSearch.FailNonContentIndexedSearch(folder, ((NotFilter)searchFilter).Filter));
                }
                if (searchFilter is FalseFilter)
                {
                    return(true);
                }
                if (searchFilter is CompositeFilter)
                {
                    return(true);
                }
            }
            return(!FolderSearch.NonContentIndexedProperties.Contains(singlePropertyFilter.Property.Name));
        }
Пример #3
0
        private static QueryFilter AuthSchemeFilterBuilder(SinglePropertyFilter filter)
        {
            ComparisonFilter comparisonFilter = filter as ComparisonFilter;

            if (comparisonFilter == null)
            {
                throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedFilterForProperty(filter.Property.Name, filter.GetType(), typeof(ComparisonFilter)));
            }
            switch (comparisonFilter.ComparisonOperator)
            {
            case ComparisonOperator.Equal:
                return(new AndFilter(new QueryFilter[]
                {
                    AuthRedirect.AuthRedirectKeywordsFilter,
                    new ComparisonFilter(ComparisonOperator.Equal, AuthRedirectSchema.Keywords, comparisonFilter.PropertyValue.ToString())
                }));

            case ComparisonOperator.NotEqual:
                return(new AndFilter(new QueryFilter[]
                {
                    AuthRedirect.AuthRedirectKeywordsFilter,
                    new ComparisonFilter(ComparisonOperator.NotEqual, AuthRedirectSchema.Keywords, comparisonFilter.PropertyValue.ToString())
                }));

            default:
                throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedOperatorForProperty(comparisonFilter.Property.Name, comparisonFilter.ComparisonOperator.ToString()));
            }
        }
Пример #4
0
        // Token: 0x060019BE RID: 6590 RVA: 0x0006C808 File Offset: 0x0006AA08
        internal static QueryFilter SendDeliveryReportsToFilterBuilder(SinglePropertyFilter filter)
        {
            DeliveryReportsReceiver deliveryReportsReceiver = (DeliveryReportsReceiver)ADObject.PropertyValueFromEqualityFilter(filter);

            switch (deliveryReportsReceiver)
            {
            case DeliveryReportsReceiver.None:
                return(new AndFilter(new QueryFilter[]
                {
                    new ComparisonFilter(ComparisonOperator.NotEqual, ADGroupSchema.ReportToOriginatorEnabled, true),
                    new ComparisonFilter(ComparisonOperator.NotEqual, ADGroupSchema.ReportToManagerEnabled, true)
                }));

            case DeliveryReportsReceiver.Manager:
                return(new ComparisonFilter(ComparisonOperator.Equal, ADGroupSchema.ReportToManagerEnabled, true));

            case DeliveryReportsReceiver.Originator:
                return(new AndFilter(new QueryFilter[]
                {
                    new ComparisonFilter(ComparisonOperator.Equal, ADGroupSchema.ReportToOriginatorEnabled, true),
                    new ComparisonFilter(ComparisonOperator.NotEqual, ADGroupSchema.ReportToManagerEnabled, true)
                }));

            default:
                throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedPropertyValue(ADGroupSchema.SendDeliveryReportsTo.Name, deliveryReportsReceiver));
            }
        }
Пример #5
0
 internal static object PropertyValueFromEqualityFilter(SinglePropertyFilter filter)
 {
     return(ADObject.PropertyValueFromComparisonFilter(filter, new List <ComparisonOperator>
     {
         ComparisonOperator.Equal
     }));
 }
Пример #6
0
        internal static QueryFilter IndexedPhoneNumbersGetterFilterBuilder(SinglePropertyFilter filter)
        {
            TextFilter textFilter = filter as TextFilter;

            if (textFilter == null)
            {
                throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedFilterForProperty(filter.Property.Name, filter.GetType(), typeof(TextFilter)));
            }
            if (MatchOptions.Prefix == textFilter.MatchOptions)
            {
                throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedMatchOptionsForProperty(textFilter.Property.Name, textFilter.MatchOptions.ToString()));
            }
            MatchOptions matchOptions;

            if (MatchOptions.Suffix == textFilter.MatchOptions)
            {
                matchOptions = MatchOptions.Prefix;
            }
            else
            {
                matchOptions = textFilter.MatchOptions;
            }
            string text = DtmfString.Reverse(textFilter.Text);

            text = "reversedPhone:" + text;
            return(new TextFilter(ADRecipientSchema.UMDtmfMap, text, matchOptions, textFilter.MatchFlags));
        }
            public override QueryFilter SmartFilterToNativeFilter(SinglePropertyFilter filter, ApplicationAggregatedProperty aggregatedProperty)
            {
                ComparisonFilter comparisonFilter = filter as ComparisonFilter;

                if (comparisonFilter == null || !comparisonFilter.Property.Equals(PersonSchema.PersonType) || comparisonFilter.ComparisonOperator != ComparisonOperator.Equal)
                {
                    return(base.SmartFilterToNativeFilter(filter, aggregatedProperty));
                }
                string text;

                switch ((PersonType)comparisonFilter.PropertyValue)
                {
                case Microsoft.Exchange.Data.PersonType.Person:
                    text = "IPM.Contact";
                    break;

                case Microsoft.Exchange.Data.PersonType.DistributionList:
                    text = "IPM.DistList";
                    break;

                default:
                    return(base.SmartFilterToNativeFilter(filter, aggregatedProperty));
                }
                return(new OrFilter(new QueryFilter[]
                {
                    new ComparisonFilter(ComparisonOperator.Equal, AggregatedContactSchema.MessageClass, text),
                    new TextFilter(AggregatedContactSchema.MessageClass, text + ".", MatchOptions.Prefix, MatchFlags.IgnoreCase)
                }));
            }
Пример #8
0
        private static QueryFilter ScopeRestrictionFlagsFilterBuilder <T>(SinglePropertyFilter filter, ScopeFlagsFormat.ConvertToMaskDelegate convertor)
        {
            if (!(filter is ComparisonFilter))
            {
                throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedFilterForProperty(filter.Property.Name, filter.GetType(), typeof(ComparisonFilter)));
            }
            ComparisonFilter comparisonFilter = (ComparisonFilter)filter;

            if (comparisonFilter.ComparisonOperator != ComparisonOperator.Equal && ComparisonOperator.NotEqual != comparisonFilter.ComparisonOperator)
            {
                throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedOperatorForProperty(comparisonFilter.Property.Name, comparisonFilter.ComparisonOperator.ToString()));
            }
            if (!(comparisonFilter.PropertyValue is T))
            {
                throw new ArgumentException("filter.PropertyValue");
            }
            QueryFilter queryFilter = new BitMaskAndFilter(ManagementScopeSchema.ScopeRestrictionFlags, convertor(comparisonFilter.PropertyValue));

            if (comparisonFilter.PropertyValue is bool && !(bool)comparisonFilter.PropertyValue)
            {
                if (ComparisonOperator.NotEqual != comparisonFilter.ComparisonOperator)
                {
                    return(new NotFilter(queryFilter));
                }
                return(queryFilter);
            }
            else
            {
                if (ComparisonOperator.NotEqual != comparisonFilter.ComparisonOperator)
                {
                    return(queryFilter);
                }
                return(new NotFilter(queryFilter));
            }
        }
Пример #9
0
        internal static QueryFilter RetainDeletedItemsUntilBackupFilterBuilder(SinglePropertyFilter filter)
        {
            LegacyDatabase.InternalAssertComparisonFilter(filter, LegacyDatabaseSchema.RetainDeletedItemsUntilBackup);
            ComparisonFilter comparisonFilter = filter as ComparisonFilter;

            return(new ComparisonFilter(comparisonFilter.ComparisonOperator, LegacyDatabaseSchema.DelItemAfterBackupEnum, ((bool)comparisonFilter.PropertyValue) ? Microsoft.Exchange.Data.Directory.Recipient.DeletedItemRetention.RetainUntilBackupOrCustomPeriod : Microsoft.Exchange.Data.Directory.Recipient.DeletedItemRetention.RetainForCustomPeriod));
        }
Пример #10
0
        internal static QueryFilter MountAtStartupFilterBuilder(SinglePropertyFilter filter)
        {
            LegacyDatabase.InternalAssertComparisonFilter(filter, LegacyDatabaseSchema.MountAtStartup);
            ComparisonFilter comparisonFilter = filter as ComparisonFilter;

            return(new ComparisonFilter(comparisonFilter.ComparisonOperator, LegacyDatabaseSchema.EdbOfflineAtStartup, !(bool)comparisonFilter.PropertyValue));
        }
Пример #11
0
        internal static object PropertyValueFromComparisonFilter(SinglePropertyFilter filter, List <ComparisonOperator> allowedOperators)
        {
            string           name             = filter.Property.Name;
            ComparisonFilter comparisonFilter = filter as ComparisonFilter;

            if (comparisonFilter == null)
            {
                throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedFilterForProperty(name, filter.GetType(), typeof(ComparisonFilter)));
            }
            if (allowedOperators != null && !allowedOperators.Contains(comparisonFilter.ComparisonOperator))
            {
                throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedOperatorForProperty(name, comparisonFilter.ComparisonOperator.ToString()));
            }
            object propertyValue = comparisonFilter.PropertyValue;

            if (propertyValue == null)
            {
                return(((ADPropertyDefinition)filter.Property).DefaultValue);
            }
            if (!ADObject.CorrectType(filter.Property, propertyValue.GetType()))
            {
                throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedPropertyValueType(name, propertyValue.GetType(), filter.Property.Type));
            }
            return(propertyValue);
        }
Пример #12
0
        private static Query BuildQueryInternal(QueryFilter filter, Dictionary <PropertyDefinition, int> propertyDefinitionToColumnMap, int depth)
        {
            if (depth == 0)
            {
                throw new ArgumentException("Depth greater then max depth specified");
            }
            SinglePropertyFilter singlePropertyFilter = filter as SinglePropertyFilter;

            if (singlePropertyFilter != null)
            {
                return(Query.BuildSinglePropertyQuery(singlePropertyFilter, propertyDefinitionToColumnMap));
            }
            CompositeFilter compositeFilter = filter as CompositeFilter;

            if (compositeFilter != null)
            {
                return(Query.BuildCompositeFilter(compositeFilter, propertyDefinitionToColumnMap, depth - 1));
            }
            NotFilter notFilter = filter as NotFilter;

            if (notFilter != null)
            {
                return(new NotQuery(Query.BuildQueryInternal(notFilter.Filter, propertyDefinitionToColumnMap, depth - 1)));
            }
            return(null);
        }
 public override QueryFilter SmartFilterToNativeFilter(SinglePropertyFilter filter, ApplicationAggregatedProperty aggregatedProperty)
 {
     if (filter != null && filter.Property.Equals(aggregatedProperty))
     {
         return(filter.CloneWithAnotherProperty(this.property));
     }
     return(base.SmartFilterToNativeFilter(filter, aggregatedProperty));
 }
 private static QueryFilter IsDefaultFilterBuilder(SinglePropertyFilter filter)
 {
     return(new AndFilter(new QueryFilter[]
     {
         ADObject.BoolFilterBuilder(filter, new BitMaskAndFilter(HostedContentFilterPolicySchema.SpamFilteringFlags, 64UL)),
         new ComparisonFilter(ComparisonOperator.Equal, ADObjectSchema.ExchangeVersion, ExchangeObjectVersion.Exchange2012)
     }));
 }
Пример #15
0
 internal static QueryFilter CapabilitiesFilterBuilder(SinglePropertyFilter filter)
 {
     if (filter is ComparisonFilter)
     {
         ComparisonFilter comparisonFilter = filter as ComparisonFilter;
         return(new ComparisonFilter(comparisonFilter.ComparisonOperator, SharedPropertyDefinitions.RawCapabilities, comparisonFilter.PropertyValue));
     }
     throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedFilterForProperty(filter.Property.Name, filter.GetType(), typeof(ComparisonFilter)));
 }
Пример #16
0
        private static void CheckFilterIsEQorNE(SinglePropertyFilter filter, out bool isNE)
        {
            ComparisonFilter comparisonFilter = filter as ComparisonFilter;

            if (comparisonFilter == null || (comparisonFilter.ComparisonOperator != ComparisonOperator.Equal && comparisonFilter.ComparisonOperator != ComparisonOperator.NotEqual))
            {
                throw new FilterOperatorMustBeEQorNEPermanentException(filter.Property.Name);
            }
            isNE = (comparisonFilter.ComparisonOperator == ComparisonOperator.NotEqual);
        }
Пример #17
0
        internal override QueryFilter SmartFilterToNativeFilter(SinglePropertyFilter filter)
        {
            QueryFilter queryFilter = this.sortByAndFilterStrategy.SmartFilterToNativeFilter(filter, this);

            if (queryFilter == null)
            {
                return(base.SmartFilterToNativeFilter(filter));
            }
            return(queryFilter);
        }
        internal static QueryFilter ProgramIdFilterBuilder(SinglePropertyFilter filter)
        {
            ComparisonFilter comparisonFilter = filter as ComparisonFilter;

            if (comparisonFilter == null)
            {
                throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedFilterForProperty(filter.Property.Name, filter.GetType(), typeof(ComparisonFilter)));
            }
            return(new TextFilter(ExchangeConfigurationUnitSchema.ResellerId, (((string)comparisonFilter.PropertyValue) ?? string.Empty) + ".", MatchOptions.Prefix, MatchFlags.IgnoreCase));
        }
Пример #19
0
        internal static QueryFilter CorrelationIdFilterBuilder(SinglePropertyFilter filter)
        {
            if (filter is ExistsFilter)
            {
                return(new ExistsFilter(ADObjectSchema.CorrelationIdRaw));
            }
            Guid guid = (Guid)ADObject.PropertyValueFromEqualityFilter(filter);

            return(new ComparisonFilter(ComparisonOperator.Equal, ADObjectSchema.CorrelationIdRaw, guid));
        }
            public override QueryFilter NativeFilterToSmartFilter(QueryFilter filter, ApplicationAggregatedProperty aggregatedProperty)
            {
                SinglePropertyFilter singlePropertyFilter = filter as SinglePropertyFilter;

                if (singlePropertyFilter != null && singlePropertyFilter.Property.Equals(this.property))
                {
                    return(singlePropertyFilter.CloneWithAnotherProperty(aggregatedProperty));
                }
                return(base.NativeFilterToSmartFilter(filter, aggregatedProperty));
            }
Пример #21
0
        internal static QueryFilter MailboxPlanReleaseFilterBuilder(SinglePropertyFilter filter)
        {
            if (!(filter is ComparisonFilter))
            {
                throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedFilterForProperty(filter.Property.Name, filter.GetType(), typeof(ComparisonFilter)));
            }
            ComparisonFilter comparisonFilter = (ComparisonFilter)filter;

            if (comparisonFilter.ComparisonOperator != ComparisonOperator.Equal && ComparisonOperator.NotEqual != comparisonFilter.ComparisonOperator)
            {
                throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedOperatorForProperty(comparisonFilter.Property.Name, comparisonFilter.ComparisonOperator.ToString()));
            }
            if (!(comparisonFilter.PropertyValue is MailboxPlanRelease))
            {
                throw new ArgumentException("filter.PropertyValue");
            }
            MailboxPlanRelease mailboxPlanRelease = (MailboxPlanRelease)comparisonFilter.PropertyValue;

            if (mailboxPlanRelease != MailboxPlanRelease.AllReleases)
            {
                if (mailboxPlanRelease != MailboxPlanRelease.CurrentRelease)
                {
                    if (mailboxPlanRelease != MailboxPlanRelease.NonCurrentRelease)
                    {
                        throw new ArgumentException("filter.PropertyValue");
                    }
                    if (comparisonFilter.ComparisonOperator == ComparisonOperator.Equal)
                    {
                        return(Microsoft.Exchange.Data.Directory.Management.MailboxPlan.NonCurrentReleaseFilter);
                    }
                    return(new NotFilter(Microsoft.Exchange.Data.Directory.Management.MailboxPlan.NonCurrentReleaseFilter));
                }
                else
                {
                    if (comparisonFilter.ComparisonOperator == ComparisonOperator.Equal)
                    {
                        return(Microsoft.Exchange.Data.Directory.Management.MailboxPlan.CurrentReleaseFilter);
                    }
                    return(new NotFilter(Microsoft.Exchange.Data.Directory.Management.MailboxPlan.CurrentReleaseFilter));
                }
            }
            else
            {
                QueryFilter queryFilter = new OrFilter(new QueryFilter[]
                {
                    Microsoft.Exchange.Data.Directory.Management.MailboxPlan.CurrentReleaseFilter,
                    Microsoft.Exchange.Data.Directory.Management.MailboxPlan.NonCurrentReleaseFilter
                });
                if (ComparisonOperator.NotEqual == comparisonFilter.ComparisonOperator)
                {
                    return(queryFilter);
                }
                return(new NotFilter(queryFilter));
            }
        }
        // Token: 0x06000DD6 RID: 3542 RVA: 0x0003FD34 File Offset: 0x0003DF34
        private void ConvertSinglePropertyFilter(SinglePropertyFilter queryFilter, QueryFilter parentFilter)
        {
            ADPropertyDefinition adpropertyDefinition = (ADPropertyDefinition)queryFilter.Property;

            if (adpropertyDefinition.LdapDisplayName == null)
            {
                if (adpropertyDefinition.CustomFilterBuilderDelegate == null)
                {
                    throw new ADFilterException(DirectoryStrings.ExceptionPropertyCannotBeSearchedOn(adpropertyDefinition.Name));
                }
                ComparisonFilter comparisonFilter = queryFilter as ComparisonFilter;
                if (comparisonFilter != null && comparisonFilter.ComparisonOperator == ComparisonOperator.NotEqual)
                {
                    QueryFilter filter = adpropertyDefinition.CustomFilterBuilderDelegate(new ComparisonFilter(ComparisonOperator.Equal, comparisonFilter.Property, comparisonFilter.PropertyValue));
                    this.BuildLdapFilter(QueryFilter.NotFilter(filter), parentFilter);
                    return;
                }
                QueryFilter queryFilter2 = adpropertyDefinition.CustomFilterBuilderDelegate(queryFilter);
                this.BuildLdapFilter(queryFilter2, parentFilter);
                return;
            }
            else
            {
                ComparisonFilter comparisonFilter2 = queryFilter as ComparisonFilter;
                if (comparisonFilter2 != null)
                {
                    this.ConvertComparisonFilter(comparisonFilter2, parentFilter);
                    return;
                }
                ExistsFilter existsFilter = queryFilter as ExistsFilter;
                if (existsFilter != null)
                {
                    this.ConvertExistsFilter(existsFilter);
                    return;
                }
                TextFilter textFilter = queryFilter as TextFilter;
                if (textFilter != null)
                {
                    this.ConvertTextFilter(textFilter);
                    return;
                }
                GenericBitMaskFilter genericBitMaskFilter = queryFilter as GenericBitMaskFilter;
                if (genericBitMaskFilter != null)
                {
                    this.ConvertBitMaskFilter(genericBitMaskFilter);
                    return;
                }
                InChainFilter inChainFilter = queryFilter as InChainFilter;
                if (inChainFilter != null)
                {
                    this.ConvertInChainFilter(inChainFilter);
                }
                return;
            }
        }
        internal static SinglePropertyFilter OrganizationNameFilterBuilder(SinglePropertyFilter filter)
        {
            if (!(filter is ComparisonFilter))
            {
                throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedFilterForProperty(filter.Property.Name, filter.GetType(), typeof(ComparisonFilter)));
            }
            string arg           = (string)((ComparisonFilter)filter).PropertyValue;
            string propertyValue = string.Format("/o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn={0}/cn=Configuration", arg);

            return(new ComparisonFilter(ComparisonOperator.Equal, OrganizationSchema.LegacyExchangeDN, propertyValue));
        }
        // Token: 0x06001956 RID: 6486 RVA: 0x0006BB24 File Offset: 0x00069D24
        private static QueryFilter PrecannedRecipientFilterFilterBuilder(SinglePropertyFilter filter, ADPropertyDefinition filterMetadata, string attributePrefix)
        {
            object           obj = ADObject.PropertyValueFromEqualityFilter(filter);
            ComparisonFilter comparisonFilter = (ComparisonFilter)filter;

            if (obj == null)
            {
                return(new NotFilter(new TextFilter(filterMetadata, attributePrefix, MatchOptions.Prefix, MatchFlags.IgnoreCase)));
            }
            return(new ComparisonFilter(comparisonFilter.ComparisonOperator, filterMetadata, attributePrefix + obj.ToString()));
        }
Пример #25
0
        internal static QueryFilter CountryOrRegionFilterBuilder(SinglePropertyFilter filter)
        {
            ComparisonFilter comparisonFilter = filter as ComparisonFilter;

            if (comparisonFilter == null)
            {
                throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedFilterForProperty(filter.Property.Name, filter.GetType(), typeof(ComparisonFilter)));
            }
            CountryInfo countryInfo = (CountryInfo)comparisonFilter.PropertyValue;

            return(new ComparisonFilter(comparisonFilter.ComparisonOperator, ADOrgPersonSchema.C, countryInfo.Name));
        }
Пример #26
0
        internal override QueryFilter SmartFilterToNativeFilter(SinglePropertyFilter filter)
        {
            ComparisonFilter comparisonFilter = filter as ComparisonFilter;

            if (comparisonFilter == null || !comparisonFilter.Property.Equals(this))
            {
                throw base.CreateInvalidFilterConversionException(filter);
            }
            PersonId personId = (PersonId)comparisonFilter.PropertyValue;

            return(new ComparisonFilter(comparisonFilter.ComparisonOperator, InternalSchema.MapiConversationId, personId.GetBytes()));
        }
Пример #27
0
        internal static QueryFilter ExchangeObjectIdFilterBuilder(SinglePropertyFilter filter)
        {
            if (filter is ExistsFilter)
            {
                return(new ExistsFilter(ADObjectSchema.ExchangeObjectIdRaw));
            }
            Guid guid = (Guid)ADObject.PropertyValueFromEqualityFilter(filter);

            return(new OrFilter(new QueryFilter[]
            {
                new ComparisonFilter(ComparisonOperator.Equal, ADObjectSchema.ExchangeObjectIdRaw, guid),
                new ComparisonFilter(ComparisonOperator.Equal, ADObjectSchema.Guid, guid)
            }));
        }
		internal override QueryFilter SmartFilterToNativeFilter(SinglePropertyFilter filter)
		{
			ComparisonFilter comparisonFilter = filter as ComparisonFilter;
			if (comparisonFilter == null)
			{
				return base.SinglePropertySmartFilterToNativeFilter(filter, this.enclosedPropertyDefinition);
			}
			StoreObjectId storeObjectId = comparisonFilter.PropertyValue as StoreObjectId;
			if (storeObjectId == null)
			{
				throw new NotSupportedException("FolderItemIdCollectionProperty only supports StoreObjectId in filters");
			}
			return new ComparisonFilter(comparisonFilter.ComparisonOperator, this.enclosedPropertyDefinition, storeObjectId.ProviderLevelItemId);
		}
Пример #29
0
        internal override QueryFilter SmartFilterToNativeFilter(SinglePropertyFilter filter)
        {
            ComparisonFilter comparisonFilter = filter as ComparisonFilter;

            if (comparisonFilter != null)
            {
                return(new ComparisonFilter(comparisonFilter.ComparisonOperator, InternalSchema.MapiInternetCpid, (string)comparisonFilter.PropertyValue));
            }
            if (filter is ExistsFilter)
            {
                return(new ExistsFilter(InternalSchema.MapiInternetCpid));
            }
            return(base.SmartFilterToNativeFilter(filter));
        }
Пример #30
0
        internal override QueryFilter NativeFilterToSmartFilter(QueryFilter filter)
        {
            SinglePropertyFilter singlePropertyFilter = filter as SinglePropertyFilter;

            if (singlePropertyFilter != null && singlePropertyFilter.Property.Equals(this.nativeProperty))
            {
                BitMaskFilter bitMaskFilter = filter as BitMaskFilter;
                if (bitMaskFilter != null && bitMaskFilter.Mask == (ulong)this.flag)
                {
                    return(new ComparisonFilter(ComparisonOperator.Equal, this, bitMaskFilter.IsNonZero));
                }
            }
            return(null);
        }