In This Article

QuickInfoSession Class

Represents an IntelliPrompt quick info session.

public class QuickInfoSession : IntelliPromptSessionBase, IEditorDocumentTextChangeEventSink, IEditorViewKeyInputEventSink, IEditorViewSelectionChangeEventSink, IQuickInfoSession, IIntelliPromptSession, IServiceLocator
Inheritance:
object IntelliPromptSessionBase object
Implements:
IEditorDocumentTextChangeEventSink IEditorViewKeyInputEventSink IEditorViewSelectionChangeEventSink IQuickInfoSession IIntelliPromptSession IServiceLocator

Constructors

QuickInfoSession(object)

Initializes an instance of the class.

public QuickInfoSession(object context)
Parameter Type Description
context object

An object that describes the context in which the quick info popup is displayed.

Properties

Bounds

The view-relative bounds of the session's open popup, if available.

public override Rect? Bounds { get; }

Property Value

Rect?

ClosesOnLostFocus

Indicates 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.

Content

The content to display in the quick info popup.

public object? Content { get; set; }

Property Value

object

Context

An object that describes the context in which the quick info popup is displayed.

public object Context { get; }

Property Value

object

ControlKeyDownOpacity

The opacity of the popup while the control key is pressed.

public double ControlKeyDownOpacity { get; set; }

Property Value

double

Remarks

Set the value to 1.0 to prevent opacity changes when the control key is pressed.

MaxWidth

The quick info popup's maximum width.

public double MaxWidth { get; set; }

Property Value

double:

The quick info popup's maximum width, or NaN to indicate no constraint. The default value is 1000.

Placement

The PlacementMode describing where to place the popup when a PlacementTarget is specified.

public PlacementMode Placement { get; }

Property Value

PlacementMode

PlacementRectangle

The PlacementTarget-relative bounds for where to target the popup when a PlacementTarget is specified.

public Rect PlacementRectangle { get; protected set; }

Property Value

Rect

PlacementTarget

The visual element against which to target the popup when not opening the session for a text range.

public UIElement? PlacementTarget { get; }

Property Value

UIElement

See Also

SessionType

The IIntelliPromptSessionType that identifies the type of session.

public override IIntelliPromptSessionType SessionType { get; }

Property Value

IIntelliPromptSessionType

Methods

CreatePopupContent()

Creates an IntelliPromptQuickInfo that is to be displayed in a popup.

protected virtual IntelliPromptQuickInfo CreatePopupContent()

Returns

IntelliPromptQuickInfo

NotifyPropertyChanged(string)

Notifies that a property's value has changed.

[Obsolete("Use one of the new SetProperty or OnPropertyChanged methods instead of this deprecated NotifyPropertyChanged method.", false)]
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

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 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 event data.

OnOpened(EventArgs)

Raises the Opened event.

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

The event data.

OnPropertyChanged(PropertyChangedEventArgs)

Raises the PropertyChanged event.

protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
Parameter Type Description
e PropertyChangedEventArgs

The event data.

OnPropertyChanged(string?)

Raises the PropertyChanged event.

protected void OnPropertyChanged(string? propertyName = null)
Parameter Type Description
propertyName string

(Optional) The name of the property that changed.

OnRequestNavigate(RequestNavigateEventArgs)

Raises the RequestNavigate event.

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

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 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 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 event data.

Open(IEditorView, PlacementMode, UIElement?, Rect)

Opens the session around a placement target, attaching to the specified IEditorView.

public void Open(IEditorView view, PlacementMode placement, UIElement? placementTarget, Rect placementRectangle)
Parameter Type Description
view IEditorView

The IEditorView in which the session is opened.

placement PlacementMode

A PlacementMode indicating the mode by which to display the quick info.

placementTarget UIElement

The target UIElement for placing the quick info.

placementRectangle Rect

The target-relative System.Windows.Rect around which to display the quick info.

Reposition()

Notifies the session that it should reposition its user interface.

public override void Reposition()

SetProperty<T>(ref T, T, string?)

Called from a property setter to change the backing field's value and raise PropertyChanged notification events if the new value is not equal to the current value.

protected bool SetProperty<T>(ref T field, T newValue, string? propertyName = null)
Type Parameters:
T -

The type of the property that changed.

Parameter Type Description
field T

The backing field that holds the property's value, which may be updated.

newValue T

The new property value.

propertyName string

(Optional) The name of the property that changed.

Returns

bool:

true if the property was changed; otherwise, false.

Events

PropertyChanged

Notifies clients that a property value has changed.

public event PropertyChangedEventHandler? PropertyChanged

Event Type

PropertyChangedEventHandler

RequestNavigate

Occurs when a hyperlink is clicked that requests navigation.

public event RequestNavigateEventHandler? RequestNavigate

Event Type

RequestNavigateEventHandler

Inherited Members

Extension Methods