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)); }
internal static void SanitizedPhoneNumber(MultiValuedProperty <string> calculatedValue, string property) { string text = DtmfString.SanitizePhoneNumber(property); if (!string.IsNullOrEmpty(text) && !calculatedValue.Contains(text)) { calculatedValue.Add(text); } }
internal static object IndexedPhoneNumbersGetter(IPropertyBag propertyBag) { MultiValuedProperty <string> multiValuedProperty = new MultiValuedProperty <string>(); MultiValuedProperty <string> multiValuedProperty2 = (MultiValuedProperty <string>)propertyBag[ADRecipientSchema.UMDtmfMap]; foreach (string text in multiValuedProperty2) { if (!string.IsNullOrEmpty(text) && text.StartsWith("reversedPhone:", StringComparison.OrdinalIgnoreCase) && text.Length > "reversedPhone:".Length) { string text2 = text.Substring("reversedPhone:".Length); if (!multiValuedProperty.Contains(text2)) { multiValuedProperty.Add(DtmfString.Reverse(text2)); } } } return(multiValuedProperty); }
public static string NormalizePhoneNumber(string phoneNumber) { return(DtmfString.DtmfEncode(phoneNumber)); }