In This Article

QuickInfoProviderBase Class

Implements an abstract base class for a quick info provider.

public abstract class QuickInfoProviderBase : IQuickInfoProvider, IEditorViewPointerInputEventSink, IOrderable, IKeyedObject
Inheritance:
object object
Derived:
CSharpQuickInfoProvider PythonQuickInfoProvider VBQuickInfoProvider XmlQuickInfoProvider CodeSnippetFieldQuickInfoProvider CollapsedRegionQuickInfoProvider IndicatorQuickInfoProvider SquiggleTagQuickInfoProvider
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

QuickInfoProviderBase()

Initializes a new instance of the QuickInfoProviderBase class.

protected QuickInfoProviderBase()

QuickInfoProviderBase(string)

Initializes a new instance of the QuickInfoProviderBase class.

protected QuickInfoProviderBase(string key)
Parameter Type Description
key string

The string-based key that identifies the provider.

QuickInfoProviderBase(string, params Ordering[])

Initializes a new instance of the QuickInfoProviderBase class.

protected QuickInfoProviderBase(string key, params Ordering[] orderings)
Parameter Type Description
key string

The string-based key that identifies the provider.

orderings Ordering[]

The array of Ordering objects, used to determine how this object is positioned relative to other objects.

Properties

CanTrackPointerInput

Gets whether to track pointer input and allow pointer movement/hovers to possibly open another quick info session.

protected bool CanTrackPointerInput { get; }

Property Value

bool:

true if pointer input can be tracked; otherwise, false.

ContextTypes

Gets 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 abstract IEnumerable<Type> ContextTypes { get; }

Property Value

IEnumerable<Type>:

The context Type objects that are supported by this provider.

Remarks

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

Key

Gets the string-based key that identifies the provider.

public string Key { get; }

Property Value

string:

The string-based key that identifies the provider.

Orderings

Gets the collection of Ordering objects, used to determine how this object is positioned relative to other objects.

public IEnumerable<Ordering> Orderings { get; }

Property Value

IEnumerable<Ordering>:

The collection of Ordering objects, used to determine how this object is positioned relative to other objects.

Methods

GetContext(IEditorView, int)

Returns an object describing the quick info context for the specified text offset, if any.

public abstract 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:

An object describing the quick info context for the specified text offset, if any. A null value indicates that no context is available.

Remarks

This method is called in response to keyboard events.

GetContext(IHitTestResult)

Returns an object describing the quick info context for the specified IHitTestResult, if any.

public virtual object GetContext(IHitTestResult hitTestResult)
Parameter Type Description
hitTestResult IHitTestResult

The IHitTestResult to examine.

Returns

object:

An object describing the quick info context for the specified IHitTestResult, if any. A null value indicates that no context is available.

Remarks

This method is called in response to pointer events.

The default implementation of this method calls the GetContext(IEditorView, int) overload if the hit test result indicates that the hit test was over a character.

RequestSession(IEditorView, object)

Requests that an IQuickInfoSession be opened for the specified IEditorView.

protected abstract 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.

RequestSession(IEditorView, object, bool)

Requests that an IQuickInfoSession be opened for the specified IEditorView.

public bool RequestSession(IEditorView view, object context, bool canTrackPointer)
Parameter Type Description
view IEditorView

The IEditorView that will host the session.

context object

A context object returned by GetContext(IHitTestResult).

canTrackPointer bool

Whether to track pointer input and allow pointer movement/hovers to possibly open another quick info session.

Returns

bool:

true if a session was opened; otherwise, false.

Inherited Members