Share via


Module.IServiceProvider.GetService(Type) Method

Definition

For a description of this member, see GetService(Type).

 virtual System::Object ^ System.IServiceProvider.GetService(Type ^ serviceType) = IServiceProvider::GetService;
object IServiceProvider.GetService (Type serviceType);
Function GetService (serviceType As Type) As Object Implements IServiceProvider.GetService

Parameters

serviceType
Type

The Type of the requested service.

Returns

The requested service object, or null if the service does not exist.

Implements

Examples

IControlPanel controlPanel = 
    (IControlPanel)GetService(typeof(IControlPanel));
ModulePageInfo modPgInfo = getModulePage();

controlPanel.RegisterPage(modPgInfo);
controlPanel.RegisterPage(
    ControlPanelCategoryInfo.HealthAndDiagnostics, modPgInfo);
Trace.WriteLine("Module.IsPageEnabled: " 
    + this.IsPageEnabled(myModPgInfo).ToString());

Applies to