Skip to main content

AutoComplete

A class in Root.Township, Alta.Meta.UI.

Case-insensitive autocomplete over an IAutoCompletionSource: prefix matches first, then other matches containing the input.

Constructors​

MemberWhat it is
AutoComplete(IAutoCompletionSource autoCompletions, int maxCompletions = 4)Creates an AutoComplete from autoCompletions and maxCompletions.

Fields​

1 private and internal field
MemberWhat it is
private IAutoCompletionSource autoCompletionsThe completion source.

Properties​

MemberWhat it is
string[] CurrentCompletions { get; private set; }The last completions returned.

Methods​

MemberWhat it is
string[] GetCompletions(string input, int required = 4)Returns matches for the input, or none if it's empty or already one of the current completions.
bool IsValidCompletion(string completion)True if the text is exactly one of the source's completions.
void TrySetNewCompletionSource(IAutoCompletionSource newSource)Switches to a new source and clears the current completions, if it's different.
2 private and internal methods
MemberWhat it is
private string[] Filter(string input, int required)Returns completions starting with the input, adding ones that contain it if there are fewer than required.
private bool HasCompletionSource(IAutoCompletionSource newSource)True if the given source is the current one.

Used in​

Members of other types that take, return or hold a AutoComplete: