In This Article

CollapsedRegionQuickInfoProvider Class

Implements a quick info provider that displays quick info tips for collapsed regions of text.

public class CollapsedRegionQuickInfoProvider : QuickInfoProviderBase, IQuickInfoProvider, IEditorViewPointerInputEventSink, IOrderable, IKeyedObject
Inheritance:
object QuickInfoProviderBase object
Implements:
IQuickInfoProvider IEditorViewPointerInputEventSink IOrderable IKeyedObject

Remarks

Instances of this object can be registered with an ISyntaxLanguage using the RegisterService(object, object) method. Once an instance is registered with the language as a service, its features can be used by the language.

Constructors

CollapsedRegionQuickInfoProvider()

Implements a quick info provider that displays quick info tips for collapsed regions of text.

public CollapsedRegionQuickInfoProvider()

Remarks

Instances of this object can be registered with an ISyntaxLanguage using the RegisterService(object, object) method. Once an instance is registered with the language as a service, its features can be used by the language.

Properties

ContextTypes

The context Type objects that are supported by this provider, which are the list of custom types that are possibly returned by the GetContext(IHitTestResult) methods.

protected override IEnumerable<Type> ContextTypes { get; }

Property Value

IEnumerable<Type>

Remarks

Base class and interface types are supported as they will match any derived classes.

IsSyntaxHighlightingEnabled

Indicates whether syntax highlighting is enabled in the quick info content.

public bool IsSyntaxHighlightingEnabled { get; set; }

Property Value

bool:

true if syntax highlighting is enabled in the quick info content; otherwise, false. The default value is true.

Methods

GetContent(IEditorView, TextSnapshotRange)

Returns the content to display in the quick info tip for the specified TextSnapshotRange.

protected virtual object? GetContent(IEditorView view, TextSnapshotRange snapshotRange)
Parameter Type Description
view IEditorView

The IEditorView for which the content is to be retrieved.

snapshotRange TextSnapshotRange

The TextSnapshotRange for which to retrieve content.

Returns

object:

The content to display in the quick info tip for the specified TextSnapshotRange.

GetContext(IEditorView, int)

Returns an object describing the quick info context for the specified text offset or null if no context is available.

public override object? GetContext(IEditorView view, int offset)
Parameter Type Description
view IEditorView

The IEditorView in which the offset is located.

offset int

The text offset to examine.

Returns

object

Remarks

This method is called in response to keyboard events.

GetContext(IHitTestResult)

Returns an object describing the quick info context for the specified IHitTestResult or null if no context is available.

public override object? GetContext(IHitTestResult hitTestResult)
Parameter Type Description
hitTestResult IHitTestResult

The IHitTestResult to examine.

Returns

object

Remarks

This method is called in response to mouse events.

RequestSession(IEditorView, object)

Requests that an IQuickInfoSession be opened for the specified IEditorView.

protected override bool RequestSession(IEditorView view, object context)
Parameter Type Description
view IEditorView

The IEditorView that will host the session.

context object

A context object returned by GetContext(IHitTestResult).

Returns

bool:

true if a session was opened; otherwise, false.

Inherited Members

Extension Methods