IVsService<T> Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides a mechanism for importing proffered services within an MEF part. This is the MEF equivalent of IAsyncServiceProvider3.
public interface IVsService<T> where T : class
type IVsService<'T (requires 'T : null)> = interface
Public Interface IVsService(Of T)
Type Parameters
- T
The service identity of and interface used to interact with the proffered service to retrieve. If T
is not registered as async or free-threaded, then this cast will be performed on the main thread.
- Derived
Remarks
This interface is safe to access from any thread.
This service acquiring interface is typically acquired via a MEF import attribute. For example: [Import] IVsService<IVsRunningDocumentTable> rdt;
When the service identity and interface are distinct types, use IVsService<TService,TInterface> instead.
Methods
GetValueAsync(CancellationToken) |
Retrieves a proffered service asynchronously, throwing an exception if it could not be retrieved. |
GetValueOrNullAsync(CancellationToken) |
Retrieves a proffered service asynchronously; otherwise, |