/// <summary> /// Converts the specified collection of searchbox items to a filter expression. /// </summary> /// <param name="searchBoxItems">A collection of searchbox items to convert.</param> /// <returns>A filter expression.</returns> /// <exception cref="ArgumentNullException">The specified value is a null reference.</exception> protected static FilterExpressionNode ConvertToFilterExpression(ICollection <SearchTextParseResult> searchBoxItems) { if (searchBoxItems == null) { throw new ArgumentNullException("searchBoxItems"); } if (searchBoxItems.Count == 0) { return(null); } else { FilterExpressionAndOperatorNode filterExpression = new FilterExpressionAndOperatorNode(); foreach (SearchTextParseResult item in searchBoxItems) { filterExpression.Children.Add(new FilterExpressionOperandNode(item.FilterRule)); } return(filterExpression); } }
/// <summary> /// Converts the specified collection of searchbox items to a filter expression. /// </summary> /// <param name="searchBoxItems">A collection of searchbox items to convert.</param> /// <returns>A filter expression.</returns> /// <exception cref="ArgumentNullException">The specified value is a null reference.</exception> protected static FilterExpressionNode ConvertToFilterExpression(ICollection<SearchTextParseResult> searchBoxItems) { if (searchBoxItems == null) { throw new ArgumentNullException("searchBoxItems"); } if (searchBoxItems.Count == 0) { return null; } else { FilterExpressionAndOperatorNode filterExpression = new FilterExpressionAndOperatorNode(); foreach (SearchTextParseResult item in searchBoxItems) { filterExpression.Children.Add(new FilterExpressionOperandNode(item.FilterRule)); } return filterExpression; } }