ServiceManager.GetService Method   
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| GetService(Type) | Retrieves the requested service.  This method returns  | 
| GetService<TServiceType>() | Retrieves the requested service. This method returns  | 
GetService(Type)
Retrieves the requested service.  This method returns null if the service could not be located.
public:
 abstract System::Object ^ GetService(Type ^ serviceType);public abstract object GetService(Type serviceType);abstract member GetService : Type -> objPublic MustOverride Function GetService (serviceType As Type) As ObjectParameters
- serviceType
- Type
The type of service to retrieve.
Returns
Returns Object, which is an instance of the service, or null if the service has not been published.
Implements
Exceptions
serviceType is null.
Applies to
GetService<TServiceType>()
Retrieves the requested service. This method returns null if the service could not be located.
public:
generic <typename TServiceType>
 TServiceType GetService();public TServiceType GetService<TServiceType>();member this.GetService : unit -> 'ServiceTypePublic Function GetService(Of TServiceType) () As TServiceTypeType Parameters
- TServiceType
The type of service to retrieve.
Returns
A generic type, which is an instance of the service, or null if the service has not been published.