ServiceProvider Class

Definition

Provides an object that can proffer services by using both the managed and unmanaged IServiceProvider interfaces.

public ref class ServiceProvider : IServiceProvider, Microsoft::VisualStudio::OLE::Interop::IServiceProvider, System::ComponentModel::Design::IServiceContainer
[System.Runtime.InteropServices.ComVisible(true)]
public class ServiceProvider : IServiceProvider, Microsoft.VisualStudio.OLE.Interop.IServiceProvider, System.ComponentModel.Design.IServiceContainer
[<System.Runtime.InteropServices.ComVisible(true)>]
type ServiceProvider = class
    interface IServiceContainer
    interface IServiceProvider
    interface IServiceProvider
Public Class ServiceProvider
Implements IServiceContainer, IServiceProvider, IServiceProvider
Inheritance
ServiceProvider
Derived
Attributes
Implements

Constructors

ServiceProvider()

Initializes a new instance of a managed or unmanaged IServiceProvider.

ServiceProvider(IServiceProvider)

Wraps an unmanaged IServiceProvider interface that is accessible through the managed IServiceProvider interface.

ServiceProvider(IServiceProvider)

Initializes a new instance of an unmanaged IServiceProvider interface.

Properties

ParentProvider

Gets the current instance of the parent service provider.

Methods

AddService(Type, Object)

Adds the specified service to the internal collection of services.

AddService(Type, Object, Boolean)

Adds the specified service to the collection of service objects or to the parent service container.

AddService(Type, ServiceCreatorCallback)

Adds the specified service to the internal collection of services.

AddService(Type, ServiceCreatorCallback, Boolean)

Adds the specified service to the internal collection of services or to the parent service container.

GetService(Guid)

Retrieves a service with a specified service GUID.

GetService(Type)

Retrieves a service of the specified type.

RemoveService(Type)

Removes the specified service from the internal services collection

RemoveService(Type, Boolean)

Removes the specified service from the internal services collection or from the parent service container.

Explicit Interface Implementations

IServiceProvider.QueryService(Guid, Guid, IntPtr)

Performs as a factory for services that are exposed through an implementation of IServiceProvider.

Extension Methods

QueryService(IServiceProvider, Guid)

Gets a service exposed by a service provider based on its service GUID.

QueryService<TService>(IServiceProvider)

Gets a service exposed by a service provider based on its service type.

Applies to