Class BasicCachedQcSuggestor<TItem>
An IQcSuggestor that caches the created IQcSuggestion objects
Inheritance
BasicCachedQcSuggestor<TItem>
Implements
Namespace: QFSW.QC
Assembly: QFSW.QC.dll
Syntax
public abstract class BasicCachedQcSuggestor<TItem> : IQcSuggestor
Type Parameters
Name | Description |
---|---|
TItem | The item type that suggestions are produced from. |
Methods
CanProvideSuggestions(SuggestionContext, SuggestorOptions)
If suggestions can be produced for the provided context.
Declaration
protected abstract bool CanProvideSuggestions(SuggestionContext context, SuggestorOptions options)
Parameters
Type | Name | Description |
---|---|---|
SuggestionContext | context | |
SuggestorOptions | options | Options used by the suggestor. |
Returns
Type | Description |
---|---|
Boolean | If suggestions can be produced. |
GetItems(SuggestionContext, SuggestorOptions)
Gets the items for a given context.
Declaration
protected abstract IEnumerable<TItem> GetItems(SuggestionContext context, SuggestorOptions options)
Parameters
Type | Name | Description |
---|---|---|
SuggestionContext | context | The context to produce items for. |
SuggestorOptions | options | Options used by the suggestor. |
Returns
Type | Description |
---|---|
IEnumerable<TItem> | The items produced. |
GetSuggestions(SuggestionContext, SuggestorOptions)
Declaration
public IEnumerable<IQcSuggestion> GetSuggestions(SuggestionContext context, SuggestorOptions options)
Parameters
Type | Name | Description |
---|---|---|
SuggestionContext | context | |
SuggestorOptions | options |
Returns
Type | Description |
---|---|
IEnumerable<IQcSuggestion> |
IsMatch(SuggestionContext, IQcSuggestion, SuggestorOptions)
Determines if the provided suggestion matches the provided context. Override to remove the filtering or add custom filtering.
Declaration
protected virtual bool IsMatch(SuggestionContext context, IQcSuggestion suggestion, SuggestorOptions options)
Parameters
Type | Name | Description |
---|---|---|
SuggestionContext | context | The context to test the suggestion against. |
IQcSuggestion | suggestion | The suggestion to test. |
SuggestorOptions | options | Options used to test the suggestion. |
Returns
Type | Description |
---|---|
Boolean | If the suggestion matches the context. |
ItemToSuggestion(TItem)
Converts an item to a suggestion.
Declaration
protected abstract IQcSuggestion ItemToSuggestion(TItem item)
Parameters
Type | Name | Description |
---|---|---|
TItem | item | The item to convert to a suggestion. |
Returns
Type | Description |
---|---|
IQcSuggestion | The converted suggestion. |