共用方式為


ServiceProvider Class

Definition

Provides methods to get the service object of a specified type.

public ref class ServiceProvider abstract sealed
public static class ServiceProvider
type ServiceProvider = class
Public Class ServiceProvider
Inheritance
ServiceProvider

Methods

GetService<T>(IServiceProvider, Boolean)

Retrieves the service object of the specified type, and throws an exception if the service is not found.

GetService<T>(IServiceProvider)

Retrieves the service object of the specified type.

Applies to