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 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
.
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 |
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 |
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 |
OnOpened(EventArgs)
Raises the Opened
event.
protected override void OnOpened(EventArgs e)
Parameter | Type | Description |
---|---|---|
e | EventArgs | An |
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 |
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 |
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 |
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.
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()