/// <summary> /// Adds a filter based on a binding path. The given token will resolve to a property at the specified <paramref name="path"/>. /// </summary> /// <param name="token">The identifier of the filter. Typically what precedes the operator in a filter.</param> /// <param name="path">The property this token should resolve to.</param> /// <param name="supportedOperatorTypes">List of supported operator tokens. Null for all operators.</param> public void AddSearchFilterProperty(string token, PropertyPath path, string[] supportedOperatorTypes = null) { SearchFilterTokens.Add(token); SearchFilterProperties.Add(new SearchFilterProperty(token, path, supportedOperatorTypes)); foreach (var backend in m_SearchBackends.Values) { backend.AddSearchFilterProperty(token, path, supportedOperatorTypes); } }
/// <summary> /// Adds a filter based on a binding path. The given token will resolve to a property at the specified <paramref name="path"/>. /// </summary> /// <param name="token">The identifier of the filter. Typically what precedes the operator in a filter.</param> /// <param name="path">The property this token should resolve to.</param> /// <param name="options">The set of filter options.</param> public void AddSearchFilterProperty(string token, PropertyPath path, SearchFilterOptions options) { SearchFilterTokens.Add(token); SearchFilterProperties.Add(new SearchFilterProperty(token, path, options)); foreach (var backend in m_SearchBackends.Values) { backend.AddSearchFilterProperty(token, path, options); } }
/// <summary> /// Adds a search filter based on a callback function. The given token will resolve to the result of the specified <paramref name="getSearchFilterFunc"/>. /// </summary> /// <param name="token">The identifier of the filter. Typically what precedes the operator in a filter.</param> /// <param name="getSearchFilterFunc">Callback used to get the object that is used in the filter. Takes an object of type TData and returns an object of type TFilter.</param> /// <param name="supportedOperatorTypes">List of supported operator tokens. Null for all operators.</param> /// <typeparam name="TData">The data type being searched.</typeparam> /// <typeparam name="TFilter">The return type for the filter.</typeparam> public void AddSearchFilterCallback <TData, TFilter>(string token, Func <TData, TFilter> getSearchFilterFunc, string[] supportedOperatorTypes = null) { SearchFilterTokens.Add(token); SearchFilterCallbacks.Add(new SearchFilterCallback <TData, TFilter> { Token = token, GetSearchFilterFunc = getSearchFilterFunc, SupportedOperatorTypes = supportedOperatorTypes }); foreach (var backend in m_SearchBackends.Values.OfType <ISearchBackend <TData> >()) { backend.AddSearchFilterCallback(token, getSearchFilterFunc, supportedOperatorTypes); } }
/// <summary> /// Adds a search filter based on a callback function. The given token will resolve to the result of the specified <paramref name="getSearchFilterFunc"/>. /// </summary> /// <param name="token">The identifier of the filter. Typically what precedes the operator in a filter.</param> /// <param name="getSearchFilterFunc">Callback used to get the object that is used in the filter. Takes an object of type TData and returns an object of type TFilter.</param> /// <param name="options">The set of filter options.</param> /// <typeparam name="TData">The data type being searched.</typeparam> /// <typeparam name="TFilter">The return type for the filter.</typeparam> public void AddSearchFilterCallback <TData, TFilter>(string token, Func <TData, TFilter> getSearchFilterFunc, SearchFilterOptions options) { SearchFilterTokens.Add(token); SearchFilterCallbacks.Add(new SearchFilterCallback <TData, TFilter> { Token = token, GetSearchFilterFunc = getSearchFilterFunc, Options = options }); foreach (var backend in m_SearchBackends.Values.OfType <ISearchBackend <TData> >()) { backend.AddSearchFilterCallback(token, getSearchFilterFunc, options); } }