In This Article

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 Rect? Bounds { get; }

Property Value

Rect?:

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 is false.

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.

public string Label { get; set; }

Property Value

string:

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 CancelEventArgs that contains the event data.

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 EventArgs that contains the event data.

OnRequestNavigate(RequestNavigateEventArgs)

Raises the RequestNavigate event.

protected virtual void OnRequestNavigate(RequestNavigateEventArgs e)
Parameter Type Description
e RequestNavigateEventArgs

An RequestNavigateEventArgs that contains the event data.

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.

public event PropertyChangedEventHandler PropertyChanged

Event Type

PropertyChangedEventHandler

RequestNavigate

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

public event RequestNavigateEventHandler RequestNavigate

Event Type

RequestNavigateEventHandler

Inherited Members