private static void updateCriteriaText(ref FilterCriteria.OptionalTextFilter textFilter, string op, string value) { switch (op) { case "=": case ":": textFilter.SearchTerm = value.Trim('"'); break; } }
/// <summary> /// Attempts to parse a keyword filter with the specified <paramref name="op"/> and textual <paramref name="value"/>. /// If the value indicates a valid textual filter, the function returns <c>true</c> and the resulting data is stored into /// <paramref name="textFilter"/>. /// </summary> /// <param name="textFilter">The <see cref="FilterCriteria.OptionalTextFilter"/> to store the parsed data into, if successful.</param> /// <param name="op"> /// The operator for the keyword filter. /// Only <see cref="Operator.Equal"/> is valid for textual filters. /// </param> /// <param name="value">The value of the keyword filter.</param> public static bool TryUpdateCriteriaText(ref FilterCriteria.OptionalTextFilter textFilter, Operator op, string value) { switch (op) { case Operator.Equal: textFilter.SearchTerm = value.Trim('"'); return(true); default: return(false); } }