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
Σχόλια
https://aka.ms/ContentUserFeedback.
Σύντομα διαθέσιμα: Καθ' όλη τη διάρκεια του 2024 θα καταργήσουμε σταδιακά τα ζητήματα GitHub ως μηχανισμό ανάδρασης για το περιεχόμενο και θα το αντικαταστήσουμε με ένα νέο σύστημα ανάδρασης. Για περισσότερες πληροφορίες, ανατρέξτε στο θέμα:Υποβολή και προβολή σχολίων για