ICompletionSession Interface
Provides the base requirements for an object that represents an IntelliPrompt completion session.
public interface ICompletionSession : IIntelliPromptSession, IServiceLocator
Properties
AllowedCharacters
Gets the CharClass containing the non-letter/digit characters allowed to be typed while the completion popup is displayed.
CharClass AllowedCharacters { get; }
Property Value
- CharClass:
The CharClass containing the non-letter/digit characters allowed to be typed while the completion popup is displayed.
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
Gets 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 istrue
.
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
Gets or sets 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 isfalse
.
See Also
CanHighlightMatchedText
Gets 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 istrue
.
See Also
CommitCharacters
Gets or sets the CharClass containing the characters that can be typed when there is a full selection to trigger a Commit().
CharClass CommitCharacters { get; }
Property Value
- CharClass:
The CharClass containing the characters that can be typed when there is a full selection to trigger a Commit().
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
Gets an object that describes the context in which the completion session is opened.
object Context { get; }
Property Value
- object:
An object that describes the context in which the completion session is opened.
See Also
ControlKeyDownOpacity
Gets the opacity of the popup while the control key is pressed.
double ControlKeyDownOpacity { get; }
Property Value
- double:
The opacity of the popup while the control key is pressed. 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
Gets 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 is800
.
See Also
DescriptionTipShowDelay
Gets or sets the TimeSpan to wait after the selection is updated before showing the description tip.
TimeSpan DescriptionTipShowDelay { get; }
Property Value
- TimeSpan:
The TimeSpan to wait after the selection is updated before showing the description tip. The default value is
400ms
.
See Also
FilteredItems
Gets the read-only collection of filtered ICompletionItem objects that are visible within the completion list.
ICompletionItemCollectionView FilteredItems { get; }
Property Value
- ICompletionItemCollectionView:
The read-only collection of filtered ICompletionItem objects that are visible within the completion list.
See Also
Filters
Gets the collection of ICompletionFilter objects that can be applied to the session.
ICompletionFilterCollection Filters { get; }
Property Value
- ICompletionFilterCollection:
The collection of ICompletionFilter objects that can be applied to the session.
See Also
IsEnterKeyHandledOnCommit
Gets 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 theEnter
key is handled (not allowed to insert a line feed) when it commits the session; otherwise,false
. The default value istrue
.
See Also
ItemMatchers
Gets the collection of ICompletionItemMatcher objects to use when matching items.
ICompletionItemMatcherCollection ItemMatchers { get; }
Property Value
- ICompletionItemMatcherCollection:
The collection of ICompletionItemMatcher objects to use when matching items.
See Also
Items
Gets the collection of ICompletionItem objects within the completion.
ICompletionItemCollection Items { get; }
Property Value
- ICompletionItemCollection:
The collection of ICompletionItem objects within the completion.
See Also
MatchOptions
Gets the CompletionMatchOptions indicating the options to use when matching items.
CompletionMatchOptions MatchOptions { get; }
Property Value
- CompletionMatchOptions:
The CompletionMatchOptions indicating the options to use when matching items.
See Also
RequiresFilterOnTextChange
Gets or sets 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 isfalse
.
See Also
Selection
Gets or sets a CompletionSelection indicating the current selection within the completion.
CompletionSelection Selection { get; set; }
Property Value
- CompletionSelection:
A CompletionSelection indicating the current selection within the completion.
See Also
TypedText
Gets 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:
The text that has been used to initialize the session and/or been entered by the end user since the session opened.
See Also
Methods
ApplyFilters()
Re-applies the active filters and rebuilds the FilteredItems collection.
Cancel()
Cancels the completion session.
CloseDescriptionTip()
Closes the description tip if it is open.
Commit()
Commits the completion session and performs an auto-complete if there is a Selection available.
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.
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 a custom 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.
Committing
Occurs before the session is committed, allowing it to be cancelled.
event EventHandler<CancelEventArgs> Committing
Event Type
See Also
RequestNavigate
Occurs when a hyperlink on a description tip is clicked that requests navigation.
event RequestNavigateEventHandler RequestNavigate
Event Type
See Also
SelectionChanged
Occurs after the Selection has changed.
Inherited Members
- IIntelliPromptSession.Close(bool)
- IIntelliPromptSession.Open(IEditorView, TextRange)
- IIntelliPromptSession.Reposition()
- IIntelliPromptSession.Bounds
- IIntelliPromptSession.ClosesOnLostFocus
- IIntelliPromptSession.IsOpen
- IIntelliPromptSession.SessionType
- IIntelliPromptSession.SnapshotRange
- IIntelliPromptSession.View
- IIntelliPromptSession.Closed
- IIntelliPromptSession.Opened
- IServiceLocator.GetAllServiceTypes()
- IServiceLocator.GetService<T>()
- IServiceLocator.GetService(object)
- IServiceLocator.RegisterService<T>(T)
- IServiceLocator.RegisterService(object, object)
- IServiceLocator.UnregisterService<T>()
- IServiceLocator.UnregisterService(object)
- IServiceLocator.SyncRoot
- IServiceLocator.ServiceAdded
- IServiceLocator.ServiceRemoved