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
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 an instance of the class.
protected QuickInfoProviderBase()
QuickInfoProviderBase(string)
Initializes an instance of the class.
protected QuickInfoProviderBase(string key)
| Parameter | Type | Description |
|---|---|---|
| key | string | The string-based key that identifies the provider. |
QuickInfoProviderBase(string, params Ordering[]?)
Initializes an instance of the 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
Indicates whether to track pointer input and allow pointer movement/hovers to possibly open another quick info session.
protected bool CanTrackPointerInput { get; }
Property Value
- bool:
trueif pointer input can be tracked; otherwise,false.
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 abstract IEnumerable<Type> ContextTypes { get; }
Property Value
Remarks
Base class and interface types are supported as they will match any derived classes.
Key
The string-based key that identifies the object.
Orderings
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
or null if no context is available.
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
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 virtual object? GetContext(IHitTestResult hitTestResult)
| Parameter | Type | Description |
|---|---|---|
| hitTestResult | IHitTestResult | The IHitTestResult to examine. |
Returns
Remarks
This method is called in response to mouse events.
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:
trueif 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:
trueif a session was opened; otherwise,false.
Inherited Members
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()