Share via


MefInjection<TService> Class

Definition

Extenders using the VisualStudio.Extensibility model to develop in-process extension can use MefInjection<TService> to retrieve MEF services through .NET dependency injection.

public class MefInjection<TService> : Microsoft.VisualStudio.Extensibility.VSSdkCompatibility.MefInjection<TService,TService> where TService : class
type MefInjection<'Service (requires 'Service : null)> = class
    inherit MefInjection<'Service, 'Service (requires 'Service : null and 'Service : null)>
Public Class MefInjection(Of TService)
Inherits MefInjection(Of TService, TService)

Type Parameters

TService

The type of the retrieved service. TService is passed to GetExtensions<T>() when retrieving the service.

Inheritance
MefInjection<TService,TService>
MefInjection<TService>

Remarks

Extensions should retrieve instances of this type through dependency injection.

Constructors

MefInjection<TService>(AsyncServiceProviderInjection<SComponentModel,IComponentModel>)

This constructor is for internal use only. Creates an instance of MefInjection<TService>.

Methods

GetServiceAsync()

Asynchronously returns the retrieved service.

(Inherited from MefInjection<TService,TInterface>)

Applies to