Freigeben über


ServiceProviderWithSite Class

Provides an object that proffers services using both the managed and unmanaged versions of the ServiceProvider interface, and can be sited using the IObjectWithSite interface.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Data.ServiceProvider
    Microsoft.VisualStudio.Data.ServiceProviderWithSite
      Microsoft.VisualStudio.Data.DataConnectionSupport

Namespace:  Microsoft.VisualStudio.Data
Assembly:  Microsoft.VisualStudio.Data (in Microsoft.VisualStudio.Data.dll)

Syntax

'Declaration
Public MustInherit Class ServiceProviderWithSite _
    Inherits ServiceProvider _
    Implements IObjectWithSite
public abstract class ServiceProviderWithSite : ServiceProvider, 
    IObjectWithSite
public ref class ServiceProviderWithSite abstract : public ServiceProvider, 
    IObjectWithSite
[<AbstractClass>]
type ServiceProviderWithSite =  
    class
        inherit ServiceProvider
        interface IObjectWithSite
    end
public abstract class ServiceProviderWithSite extends ServiceProvider implements IObjectWithSite

The ServiceProviderWithSite type exposes the following members.

Constructors

  Name Description
Protected method ServiceProviderWithSite Class constructor. Instantiates a new instance of the ServiceProviderWithSite class.

Top

Properties

  Name Description
Protected property ServiceTypes Retrieves a list of service types used to convert the unmanaged QueryService method call, in which a service GUID is specified, into a managed IServiceProvider.GetService method call, in which a managed type is specified. (Inherited from ServiceProvider.)
Public property Site Retrieves or sets the site object instance.

Top

Methods

  Name Description
Public method Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetService(Guid) Retrieves a service with a specified service GUID. (Inherited from ServiceProvider.)
Public method GetService(Type) Retrieves a service of the specified type. (Inherited from ServiceProvider.)
Protected method GetServiceImpl(Guid) Provides the implementation for retrieving a service with a specific GUID. (Inherited from ServiceProvider.)
Protected method GetServiceImpl(Type) Provides the implementation for retrieving a service of a specific type. (Inherited from ServiceProvider.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method OnSiteChanged Raises the SiteChanged event.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Events

  Name Description
Public event SiteChanged Event raised when the Site property has changed.

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IObjectWithSite.GetSite Retrieves the last site set using the IObjectWithSite.SetSite method. If there is no known site, an exception is thrown.
Explicit interface implemetationPrivate method IServiceProvider.QueryService Performs as a factory for services that are exposed through an implementation of IServiceProvider. (Inherited from ServiceProvider.)
Explicit interface implemetationPrivate method IObjectWithSite.SetSite Provides a site's IUnknown pointer to a given object.

Top

Remarks

This object essentially provides multiple inheritance from both the ServiceProvider and the ObjectWithSite classes. It actually inherits from the ServiceProvider class and has an IObjectWithSite object as a member variable, to which it delegates the implementation of IObjectWithSite.

This class is useful as a base class for any class that needs to be a service provider that is also able to be sited.

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.

See Also

Reference

Microsoft.VisualStudio.Data Namespace

IServiceProvider