Table of Contents

Class CollectionNavigatorBase

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

Navigates a collection of items using keystrokes. The keystrokes are used to build a search string. The SearchString is used to find the next item in the collection that matches the search string when GetNextMatchingItem(int, char) is called.

If the user types keystrokes that can't be found in the collection, the search string is cleared and the next item is found that starts with the last keystroke.

If the user pauses keystrokes for a short time (see TypingDelay), the search string is cleared.

public abstract class CollectionNavigatorBase
Inheritance
CollectionNavigatorBase
Derived
Inherited Members

Properties

Comparer

The comparer function to use when searching the collection.

SearchString

Gets the current search string. This includes the set of keystrokes that have been pressed since the last unsuccessful match or after TypingDelay) milliseconds. Useful for debugging.

TypingDelay

Gets or sets the number of milliseconds to delay before clearing the search string. The delay is reset on each call to GetNextMatchingItem(int, char). The default is 500ms.

Methods

ElementAt(int)

Returns the collection being navigated element at idx.

GetCollectionLength()

Return the number of elements in the collection

GetNextMatchingItem(int, char)

Gets the index of the next item in the collection that matches the current SearchString plus the provided character (typically from a key press).

IsCompatibleKey(Key)

Returns true if a is a searchable key (e.g. letters, numbers, etc) that are valid to pass to this class for search filtering.

OnSearchStringChanged(KeystrokeNavigatorEventArgs)

Invoked when the SearchString changes. Useful for debugging. Invokes the SearchStringChanged event.

Events

SearchStringChanged

This event is invoked when SearchString changes. Useful for debugging.