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 -> obj
Public MustOverride Function GetService (serviceType As Type) As Object
Parameters
- 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 -> 'ServiceType
Public Function GetService(Of TServiceType) () As TServiceType
Type 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.
Applies to
Commenti e suggerimenti
https://aka.ms/ContentUserFeedback.
Presto disponibile: nel corso del 2024 verranno dismessi i problemi di GitHub come meccanismo di feedback per il contenuto e verranno sostituiti con un nuovo sistema di feedback. Per altre informazioni, vedere:Invia e visualizza il feedback per