In This Article

CodeSnippetTemplateSession Class

Represents an IntelliPrompt code snippet template session.

public class CodeSnippetTemplateSession : IntelliPromptSessionBase, ICodeSnippetTemplateSession, IIntelliPromptSession, IServiceLocator, IEditorDocumentTextChangeEventSink, IEditorViewKeyInputEventSink, IEditorViewSelectionChangeEventSink
Inheritance:
object IntelliPromptSessionBase object
Implements:
ICodeSnippetTemplateSession IIntelliPromptSession IServiceLocator IEditorDocumentTextChangeEventSink IEditorViewKeyInputEventSink IEditorViewSelectionChangeEventSink

Constructors

CodeSnippetTemplateSession()

Initializes a new instance of the CodeSnippetTemplateSession class.

public CodeSnippetTemplateSession()

Properties

ActiveDeclaration

Gets the ICodeSnippetDeclaration that is currently active, if any.

public ICodeSnippetDeclaration ActiveDeclaration { get; }

Property Value

ICodeSnippetDeclaration:

The ICodeSnippetDeclaration that is currently active, if any.

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.

CodeSnippet

Gets or sets the code snippet to activate.

public ICodeSnippet CodeSnippet { get; set; }

Property Value

ICodeSnippet:

The code snippet to activate.

IsAutoIndentEnabled

Gets or sets whether to auto-indent code snippet code based on the tabstop level of the current line.

public bool IsAutoIndentEnabled { get; set; }

Property Value

bool:

true if the code snippet code should be auto-indented; otherwise, false.

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

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.

OnDocumentTextChanged(SyntaxEditor, EditorSnapshotChangedEventArgs)

Occurs after a text change occurs to an IEditorDocument that uses this language.

protected virtual void OnDocumentTextChanged(SyntaxEditor editor, EditorSnapshotChangedEventArgs e)
Parameter Type Description
editor SyntaxEditor

The SyntaxEditor whose IEditorDocument is changed.

e EditorSnapshotChangedEventArgs

The EditorSnapshotChangedEventArgs that contains the event data.

OnDocumentTextChanging(SyntaxEditor, EditorSnapshotChangingEventArgs)

Occurs before a text change occurs to an IEditorDocument that uses this language.

protected virtual void OnDocumentTextChanging(SyntaxEditor editor, EditorSnapshotChangingEventArgs e)
Parameter Type Description
editor SyntaxEditor

The SyntaxEditor whose IEditorDocument is changed.

e EditorSnapshotChangingEventArgs

The EditorSnapshotChangingEventArgs that contains the event data.

OnOpened(EventArgs)

Raises the Opened event.

protected override void OnOpened(EventArgs e)
Parameter Type Description
e EventArgs

An EventArgs that contains the event data.

OnViewKeyDown(IEditorView, KeyEventArgs)

Occurs when a key is pressed down while focus is in the specified IEditorView.

protected virtual void OnViewKeyDown(IEditorView view, KeyEventArgs e)
Parameter Type Description
view IEditorView

The IEditorView that received the event.

e KeyEventArgs

The KeyEventArgs that contains the event data.

OnViewKeyUp(IEditorView, KeyEventArgs)

Occurs when a key is released while focus is in the specified IEditorView.

protected virtual void OnViewKeyUp(IEditorView view, KeyEventArgs e)
Parameter Type Description
view IEditorView

The IEditorView that received the event.

e KeyEventArgs

The KeyEventArgs that contains the event data.

OnViewSelectionChanged(IEditorView, EditorViewSelectionEventArgs)

Occurs when the selection is changed in the specified IEditorView.

protected virtual void OnViewSelectionChanged(IEditorView view, EditorViewSelectionEventArgs e)
Parameter Type Description
view IEditorView

The IEditorView that received the event.

e EditorViewSelectionEventArgs

The EditorViewSelectionEventArgs that contains the event data.

Open(IEditorView)

Opens the session, attaching to the specified IEditorView, and uses the current selection as the target snapshot range.

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

Inherited Members