ServiceProvider Class
Provides an object that can proffer services by using both the managed and unmanaged IServiceProvider interfaces.
Inheritance Hierarchy
System.Object
Microsoft.VisualStudio.Data.Framework.ServiceProvider
Microsoft.VisualStudio.Data.Framework.DataSiteableServiceProvider<T>
Namespace: Microsoft.VisualStudio.Data.Framework
Assembly: Microsoft.VisualStudio.Data.Framework (in Microsoft.VisualStudio.Data.Framework.dll)
Syntax
'Declaration
<ComVisibleAttribute(True)> _
Public Class ServiceProvider _
Implements IServiceContainer, IServiceProvider, IServiceProvider
[ComVisibleAttribute(true)]
public class ServiceProvider : IServiceContainer,
IServiceProvider, IServiceProvider
[ComVisibleAttribute(true)]
public ref class ServiceProvider : IServiceContainer,
IServiceProvider, IServiceProvider
[<ComVisibleAttribute(true)>]
type ServiceProvider =
class
interface IServiceContainer
interface IServiceProvider
interface IServiceProvider
end
public class ServiceProvider implements IServiceContainer, IServiceProvider, IServiceProvider
The ServiceProvider type exposes the following members.
Constructors
Name | Description | |
---|---|---|
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. |
Top
Properties
Name | Description | |
---|---|---|
ParentProvider | Gets the current instance of the parent service provider. |
Top
Methods
Name | Description | |
---|---|---|
AddService(Type, ServiceCreatorCallback) | Adds the specified service to the internal collection of services. | |
AddService(Type, Object) | 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. | |
AddService(Type, Object, Boolean) | Adds the specified service to the collection of service objects or to the parent service container. | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetService(Guid) | Retrieves a service with a specified service GUID. | |
GetService(Type) | Retrieves a service of the specified type. | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
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. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Explicit Interface Implementations
Name | Description | |
---|---|---|
IServiceProvider.QueryService | Performs as a factory for services that are exposed through an implementation of IServiceProvider. |
Top
Remarks
Note
In the syntax block above, the class inheritance derives from both the managed and the unmanaged IServiceProvider interfaces. That is, the first (unmanaged) derives from the IServiceProvider interface and the second (managed) derives from IServiceProvider.
This class serves two purposes. First, it provides a managed class for creating an implementation of the unmanaged or managed IServiceProvider interfaces. Second, it provides a managed class for wrapping and extending an existing implementation of the unmanaged or managed IServiceProvider interfaces.
For both cases, the managed IServiceProvider interface is also implemented, so managed clients of the object can communicate with the object by using managed-friendly code.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.