CodeSnippetSelectionSession Class
Represents an IntelliPrompt code snippet selection session.
public class CodeSnippetSelectionSession : IntelliPromptSessionBase, ICodeSnippetSelectionSession, IIntelliPromptSession, IServiceLocator, IEditorViewPointerInputEventSink
- Inheritance:
- object IntelliPromptSessionBase object
- Implements:
- ICodeSnippetSelectionSession IIntelliPromptSession IServiceLocator IEditorViewPointerInputEventSink
Constructors
CodeSnippetSelectionSession()
Initializes a new instance of the CodeSnippetSelectionSession
class.
public CodeSnippetSelectionSession()
Properties
Bounds
Gets the view-relative bounds of the session's open popup, if available.
public override Rectangle? Bounds { get; }
Property Value
- Rectangle?:
The view-relative bounds of the session's open popup, if available.
CanOpenForReadOnlyTextRanges
Gets whether the session is able to be opened for read-only text ranges.
protected override bool CanOpenForReadOnlyTextRanges { get; }
Property Value
- bool:
true
if the session is able to be opened for read-only text ranges; otherwise,false
. The default value isfalse
.
ClosesOnLostFocus
Returns whether this session auto-closes when the editor or any IntelliPrompt popups lose focus.
public override bool ClosesOnLostFocus { get; }
Property Value
- bool:
true
if this session auto-closes when the editor or any IntelliPrompt popups lose focus; otherwise,false
.
Label
Gets or sets the label text to display on the popup.
RootFolder
Gets or sets the root ICodeSnippetFolder containing the code snippets to display.
public ICodeSnippetFolder RootFolder { get; set; }
Property Value
- ICodeSnippetFolder:
The root ICodeSnippetFolder containing the code snippets to display.
SessionType
Gets the IIntelliPromptSessionType that identifies the type of session.
public override IIntelliPromptSessionType SessionType { get; }
Property Value
- IIntelliPromptSessionType:
The IIntelliPromptSessionType that identifies the type of session.
Methods
CreateDescriptionProvider(ICodeSnippetMetadata)
Creates an IContentProvider that provides a completion list description tip for the specified ICodeSnippetMetadata.
protected virtual IContentProvider CreateDescriptionProvider(ICodeSnippetMetadata metadata)
Parameter | Type | Description |
---|---|---|
metadata | ICodeSnippetMetadata | The ICodeSnippetMetadata to examine. |
Returns
- IContentProvider:
The IContentProvider to use.
CreatePopupContent()
Creates an IntelliPromptCodeSnippetSelector that is to be displayed in a popup.
protected virtual IntelliPromptCodeSnippetSelector CreatePopupContent()
Returns
- IntelliPromptCodeSnippetSelector:
The control that was created.
NotifyPropertyChanged(string)
Notifies that a property's value has changed.
protected void NotifyPropertyChanged(string name)
Parameter | Type | Description |
---|---|---|
name | string | The name of the property. |
OnClosed(CancelEventArgs)
Raises the Closed
event.
protected override void OnClosed(CancelEventArgs e)
Parameter | Type | Description |
---|---|---|
e | CancelEventArgs | An |
OnCompletionSessionInitializing(ICompletionSession)
Called when the ICompletionSession used for this code snippet selection session in about to be initialized.
protected virtual void OnCompletionSessionInitializing(ICompletionSession session)
Parameter | Type | Description |
---|---|---|
session | ICompletionSession | The ICompletionSession to initialize. |
Remarks
Override this method to set custom settings on the ICompletionSession before it is opened. The default implementation of this method sorts the items in the session.
OnOpened(EventArgs)
Raises the Opened
event.
protected override void OnOpened(EventArgs e)
Parameter | Type | Description |
---|---|---|
e | EventArgs | An |
OnViewPointerPressed(IEditorView, InputPointerButtonEventArgs)
Occurs when a pointer button is pressed over the specified IEditorView.
protected virtual void OnViewPointerPressed(IEditorView view, InputPointerButtonEventArgs e)
Parameter | Type | Description |
---|---|---|
view | IEditorView | The IEditorView that received the event. |
e | InputPointerButtonEventArgs | The InputPointerButtonEventArgs that contains the event data. |
Open(IEditorView)
Opens the session, attaching to the specified IEditorView.
public void Open(IEditorView view)
Parameter | Type | Description |
---|---|---|
view | IEditorView | The IEditorView in which the session is opened. |
Reposition()
Notifies the session that it should reposition its user interface.
public override void Reposition()
Events
PropertyChanged
Occurs when a property value is changed.
Inherited Members
- IntelliPromptSessionBase.GetAllServiceTypes()
- IntelliPromptSessionBase.GetService<T>()
- IntelliPromptSessionBase.GetService(object)
- IntelliPromptSessionBase.RegisterService<T>(T)
- IntelliPromptSessionBase.RegisterService(object, object)
- IntelliPromptSessionBase.UnregisterService<T>()
- IntelliPromptSessionBase.UnregisterService(object)
- IntelliPromptSessionBase.Close(bool)
- IntelliPromptSessionBase.OnServiceAdded(CollectionChangeEventArgs<object>)
- IntelliPromptSessionBase.OnServiceRemoved(CollectionChangeEventArgs<object>)
- IntelliPromptSessionBase.Open(IEditorView, TextRange)
- IntelliPromptSessionBase.GetPopupBounds(PopupControl)
- IntelliPromptSessionBase.IsOpen
- IntelliPromptSessionBase.SnapshotRange
- IntelliPromptSessionBase.SyncRoot
- IntelliPromptSessionBase.View
- IntelliPromptSessionBase.Closed
- IntelliPromptSessionBase.Opened
- IntelliPromptSessionBase.ServiceAdded
- IntelliPromptSessionBase.ServiceRemoved
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()