// Token: 0x06000DDF RID: 3551 RVA: 0x00040AB3 File Offset: 0x0003ECB3
 private void ConvertAnrFilter(AmbiguousNameResolutionFilter anrFilter)
 {
     this.IncrementFilterSize();
     this.ldapFilter.Append("(anr=");
     ADValueConvertor.EscapeAndAppendString(anrFilter.ValueToMatch, this.ldapFilter);
     this.ldapFilter.Append(")");
 }
        // Token: 0x06000DDB RID: 3547 RVA: 0x00040790 File Offset: 0x0003E990
        private void ConvertTextFilter(TextFilter textFilter)
        {
            if (textFilter.Property.Type.IsEnum)
            {
                throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedOperatorForProperty(textFilter.Property.Name, "LIKE"));
            }
            ADPropertyDefinition adpropertyDefinition = (ADPropertyDefinition)textFilter.Property;
            string ldapDisplayName = adpropertyDefinition.LdapDisplayName;

            this.IncrementFilterSize();
            this.ldapFilter.Append("(");
            this.ldapFilter.Append(ldapDisplayName);
            this.ldapFilter.Append("=");
            switch (textFilter.MatchOptions)
            {
            case MatchOptions.FullString:
                ADValueConvertor.ConvertToAndAppendFilterString(adpropertyDefinition, textFilter.Text, this.ldapFilter, false, 0);
                this.ldapFilter.Append(")");
                return;

            case MatchOptions.SubString:
                this.ldapFilter.Append("*");
                ADValueConvertor.ConvertToAndAppendFilterString(adpropertyDefinition, textFilter.Text, this.ldapFilter, false, 0);
                this.ldapFilter.Append("*)");
                return;

            case MatchOptions.Prefix:
                ADValueConvertor.ConvertToAndAppendFilterString(adpropertyDefinition, textFilter.Text, this.ldapFilter, false, 0);
                this.ldapFilter.Append("*)");
                return;

            case MatchOptions.Suffix:
                this.ldapFilter.Append("*");
                ADValueConvertor.ConvertToAndAppendFilterString(adpropertyDefinition, textFilter.Text, this.ldapFilter, false, 0);
                this.ldapFilter.Append(")");
                return;

            case MatchOptions.WildcardString:
                ADValueConvertor.EscapeAndAppendString(textFilter.Text, this.ldapFilter, true);
                this.ldapFilter.Append(")");
                return;
            }
            throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedTextFilterOption(textFilter.MatchOptions.ToString()));
        }
Example #3
0
            public static string BuildHostedRecipientAddressQuery(string attributeName, List <string> addressList)
            {
                StringBuilder stringBuilder = new StringBuilder();

                stringBuilder.Append("(&");
                stringBuilder.Append("(msExchCU=*)(msExchOURoot=*)");
                stringBuilder.Append("(|");
                StringBuilder stringBuilder2 = new StringBuilder();
                string        value;

                if (string.Equals(attributeName, "msExchUMAddresses", StringComparison.OrdinalIgnoreCase))
                {
                    value = "=meum:";
                }
                else
                {
                    value = "=smtp:";
                }
                foreach (string originalValue in addressList)
                {
                    stringBuilder2.Append("(");
                    stringBuilder2.Append(attributeName);
                    stringBuilder2.Append(value);
                    ADValueConvertor.EscapeAndAppendString(originalValue, stringBuilder2);
                    stringBuilder2.Append(")");
                }
                stringBuilder.Append(stringBuilder2.ToString());
                stringBuilder.Append(")");
                stringBuilder.Append("(|");
                foreach (string value2 in Schema.Query.supportedHostedRecipientClasses)
                {
                    stringBuilder.Append("(objectClass=");
                    stringBuilder.Append(value2);
                    stringBuilder.Append(")");
                }
                stringBuilder.Append("))");
                return(stringBuilder.ToString());
            }