In This Article

ICompletionSession Interface

Provides the base requirements for an object that represents an IntelliPrompt completion session.

public interface ICompletionSession : IIntelliPromptSession, IServiceLocator

Properties

AllowedCharacters

The CharClass containing the non-letter/digit characters allowed to be typed while the completion popup is displayed.

CharClass AllowedCharacters { get; }

Property Value

CharClass

Remarks

All letter and digit characters are automatically allowed by the completion popup and therefore do not need to added to this property. This property should only contain additional non-letter/digit characters that need to be allowed.

When a character is typed, it's first checked to see if it's a letter, number, or is in the AllowedCharacters collection. If any of those cases is true, the character is entered into the editor and the session remains open. If instead the character is in the CommitCharacters collection and there is a full selection in the completion list, a Commit() occurs. Otherwise, the session is cancelled.

See Also

CanCommitWithoutPopup

Indicates whether the session can immediately commit if a single match is made when the session is opened, commonly known as "complete word" functionality.

bool CanCommitWithoutPopup { get; }

Property Value

bool:

true if the session can immediately commit if a single match is made when the session is opened; otherwise, false. The default value is true.

Remarks

A value of false will force the popup list to always display, even if a single match is made upon open.

See Also

CanFilterUnmatchedItems

Indicates whether to filter out items that don't match the typed text, thereby shrinking the list of visible items.

bool CanFilterUnmatchedItems { get; }

Property Value

bool:

true if items that don't match the typed text should be filtered out, thereby shrinking the list of visible items; otherwise, false. The default value is false.

See Also

CanHighlightMatchedText

Indicates whether list items show possible matched characters in a highlight color.

bool CanHighlightMatchedText { get; }

Property Value

bool:

true if list items show possible matched characters in a highlight color; otherwise, false. The default value is true.

See Also

CommitCharacters

The CharClass containing the characters that can be typed to trigger a Commit() when there is a full selection.

CharClass CommitCharacters { get; }

Property Value

CharClass

Remarks

The default value of this property is a CharClass that contains all characters.

When a character is typed, it's first checked to see if it's a letter, number, or is in the AllowedCharacters collection. If any of those cases is true, the character is entered into the editor and the session remains open. If instead the character is in the CommitCharacters collection and there is a full selection in the completion list, a Commit() occurs. Otherwise, the session is cancelled.

See Also

Context

An object that describes the context in which the completion session is opened.

object? Context { get; }

Property Value

object

See Also

ControlKeyDownOpacity

The opacity of the popup while the control key is pressed.

double ControlKeyDownOpacity { get; }

Property Value

double:

The default value is 0.25.

Remarks

Set the value to 1.0 to prevent opacity changes when the control key is pressed.

See Also

DescriptionTipMaxWidth

The description tip popup's maximum width.

double DescriptionTipMaxWidth { get; }

Property Value

double:

The description tip popup's maximum width, or NaN to indicate no constraint. The default value is 800.

See Also

DescriptionTipShowDelay

The TimeSpan to wait after the selection is updated before showing the description tip.

TimeSpan DescriptionTipShowDelay { get; }

Property Value

TimeSpan:

The default value is 400ms.

See Also

FilteredItems

The read-only collection of filtered ICompletionItem objects that are visible within the completion list.

ICompletionItemCollectionView FilteredItems { get; }

Property Value

ICompletionItemCollectionView

See Also

Filters

The collection of ICompletionFilter objects that can be applied to the session.

ICompletionFilterCollection Filters { get; }

Property Value

ICompletionFilterCollection

See Also

IsEnterKeyHandledOnCommit

Indicates whether the Enter key is handled (not allowed to insert a line feed) when it commits the session.

bool IsEnterKeyHandledOnCommit { get; }

Property Value

bool:

true if the Enter key is handled (not allowed to insert a line feed) when it commits the session; otherwise, false. The default value is true.

See Also

ItemMatchers

The collection of ICompletionItemMatcher objects to use when matching items.

ICompletionItemMatcherCollection ItemMatchers { get; }

Property Value

ICompletionItemMatcherCollection

See Also

Items

The collection of ICompletionItem objects within the completion.

ICompletionItemCollection Items { get; }

Property Value

ICompletionItemCollection

See Also

MatchOptions

The CompletionMatchOptions indicating the options to use when matching items.

CompletionMatchOptions MatchOptions { get; }

Property Value

CompletionMatchOptions

See Also

RequiresFilterOnTextChange

Indicates whether to apply filters when a text change occurs.

bool RequiresFilterOnTextChange { get; set; }

Property Value

bool:

true if filters should be applied when a text change occurs; otherwise, false. The default value is false.

See Also

Selection

A CompletionSelection indicating the current selection within the completion.

CompletionSelection? Selection { get; set; }

Property Value

CompletionSelection

See Also

TypedText

The text that has been used to initialize the session and/or been entered by the end user since the session opened.

string TypedText { get; }

Property Value

string

See Also

Methods

ApplyFilters()

Re-applies the active filters and rebuilds the FilteredItems collection.

void ApplyFilters()

See Also

Cancel()

Cancels the completion session.

void Cancel()

See Also

CloseDescriptionTip()

Closes the description tip if it is open.

void CloseDescriptionTip()

See Also

Commit()

Commits the completion session and performs an auto-complete if there is a Selection available.

void Commit()

See Also

Open(IEditorView)

Opens the session, attaching to the specified IEditorView.

void Open(IEditorView view)
Parameter Type Description
view IEditorView

The IEditorView in which the session is opened.

See Also

RestartDescriptionTipTimer()

Restarts the description tip display timer.

void RestartDescriptionTipTimer()

See Also

SortItems()

Sorts the items in the session using the default sort comparer.

void SortItems()

Remarks

Items should always be sorted before the session is opened for an optimal user experience. This method should be called to sort the items right before the session is opened if the items were not pre-sorted.

See Also

SortItems(IComparer<ICompletionItem>)

Sorts the items in the session using the default sort comparer.

void SortItems(IComparer<ICompletionItem> comparer)
Parameter Type Description
comparer IComparer<ICompletionItem>

The IComparer<T> to use.

Remarks

Items should always be sorted before the session is opened for an optimal user experience. This method should be called to sort the items right before the session is opened if the items were not pre-sorted.

See Also

Events

Committed

Occurs after the session is committed.

event EventHandler Committed

Event Type

EventHandler

See Also

Committing

Occurs before the session is committed, allowing it to be cancelled.

event EventHandler<CancelEventArgs> Committing

Event Type

EventHandler<CancelEventArgs>

See Also

RequestNavigate

Occurs when a hyperlink on a description tip is clicked that requests navigation.

event RequestNavigateEventHandler RequestNavigate

Event Type

RequestNavigateEventHandler

See Also

SelectionChanged

Occurs after the Selection has changed.

event EventHandler SelectionChanged

Event Type

EventHandler

See Also

Inherited Members

Extension Methods

See Also