C# Class VSEmbed.VsServiceProvider

An out-of-process implementation of Visual Studio's singleton OLE ServiceProvider.
Visual Studio services use this class, both through MEF SVsServiceProvider and Shell.ServiceProvider.GlobalProvider, to load COM services. I need to provide every service used in editor and theme codepaths. Most of the service methods are never actually called. This must be initialized before theme dictionaries or editor services are used
Inheritance: Microsoft.VisualStudio.OLE.Interop.IServiceProvider, SVsServiceProvider
显示文件 Open project: SLaks/VSEmbed Class Usage Examples

Private Properties

Property Type Description
AddTaskSchedulerService void
Initialize void
OLE int

Public Methods

Method Description
AddService ( System.Guid serviceGuid, object instance ) : void

Adds a new service to the provider (or replaces an existing service).

AddService ( Type serviceType, object instance ) : void

Adds a new service to the provider (or replaces an existing service).

GetService ( Type serviceType ) : object

Gets the specified service from the provider, or null if it has not been registered.

SetMefContainer ( IComponentModel container ) : void

Registers a MEF container in this ServiceProvider.

This is used to provide the IComponentModel service, which is used by many parts of Roslyn and the editor. It's also used by our TextViewHost wrapper control to access the MEF container.

Private Methods

Method Description
AddTaskSchedulerService ( ) : void
Initialize ( ) : void
OLE ( [ guidService, [ riid, IntPtr &ppvObject ) : int

Method Details

AddService() public method

Adds a new service to the provider (or replaces an existing service).
public AddService ( System.Guid serviceGuid, object instance ) : void
serviceGuid System.Guid
instance object
return void

AddService() public method

Adds a new service to the provider (or replaces an existing service).
public AddService ( Type serviceType, object instance ) : void
serviceType System.Type
instance object
return void

GetService() public method

Gets the specified service from the provider, or null if it has not been registered.
public GetService ( Type serviceType ) : object
serviceType System.Type
return object

SetMefContainer() public method

Registers a MEF container in this ServiceProvider.
This is used to provide the IComponentModel service, which is used by many parts of Roslyn and the editor. It's also used by our TextViewHost wrapper control to access the MEF container.
public SetMefContainer ( IComponentModel container ) : void
container IComponentModel
return void