Class MostRecentlyUsedMatcher<T>
- Namespace
- Whim.CommandPalette
- Assembly
- Whim.CommandPalette.dll
MostRecentlyUsedMatcher will return matches in the order of most recently used.
public class MostRecentlyUsedMatcher<T> : IMatcher<T>
Type Parameters
T
- Inheritance
-
MostRecentlyUsedMatcher<T>
- Implements
-
IMatcher<T>
- Inherited Members
Properties
Filter
The filter to use when matching commands.
public PaletteFilter Filter { get; set; }
Property Value
Methods
LoadState(JsonElement)
Load the matcher's state from
state
.public void LoadState(JsonElement state)
Parameters
state
JsonElement- The matcher's state.
Match(string, IReadOnlyList<IVariantRowModel<T>>)
Matcher returns an ordered list of filtered matches for the
query
.public IEnumerable<MatcherResult<T>> Match(string query, IReadOnlyList<IVariantRowModel<T>> inputItems)
Parameters
query
stringinputItems
IReadOnlyList<IVariantRowModel<T>>
Returns
OnMatchExecuted(IVariantRowModel<T>)
Called when a match has been executed. This is used by the IMatcher<TData>
implementation to update relevant internal state.
public void OnMatchExecuted(IVariantRowModel<T> item)
Parameters
item
IVariantRowModel<T>
SaveState()
Save the matcher's state as a JsonElement.
public JsonElement? SaveState()
Returns
- JsonElement?
- The matcher's state.