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
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:
trueif 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
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:
trueif 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
Indicates whether list items show possible matched characters in a highlight color.
bool CanHighlightMatchedText { get; }
Property Value
- bool:
trueif list items show possible matched characters in a highlight color; otherwise,false. The default value istrue.
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
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.
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
NaNto indicate no constraint. The default value is800.
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
See Also
Filters
The collection of ICompletionFilter objects that can be applied to the session.
ICompletionFilterCollection Filters { get; }
Property Value
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:
trueif theEnterkey is handled (not allowed to insert a line feed) when it commits the session; otherwise,false. The default value istrue.
See Also
ItemMatchers
The collection of ICompletionItemMatcher objects to use when matching items.
ICompletionItemMatcherCollection ItemMatchers { get; }
Property Value
See Also
Items
The collection of ICompletionItem objects within the completion.
ICompletionItemCollection Items { get; }
Property Value
See Also
MatchOptions
The CompletionMatchOptions indicating the options to use when matching items.
CompletionMatchOptions MatchOptions { get; }
Property Value
See Also
RequiresFilterOnTextChange
Indicates whether to apply filters when a text change occurs.
bool RequiresFilterOnTextChange { get; set; }
Property Value
- bool:
trueif filters should be applied when a text change occurs; otherwise,false. The default value isfalse.
See Also
Selection
A CompletionSelection indicating the current selection within the completion.
CompletionSelection? Selection { get; set; }
Property Value
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.
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 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.
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
Extension Methods
- ObjectExtensions.TryConvertToDouble(object, out double)
- ObjectExtensions.TryConvertToDouble(object, IFormatProvider, out double)