NestedContainer.GetService(Type) 方法

定義

取得指定型別的服務物件 (如果有的話)。Gets the service object of the specified type, if it is available.

protected:
 override System::Object ^ GetService(Type ^ service);
protected override object GetService (Type service);
override this.GetService : Type -> obj
Protected Overrides Function GetService (service As Type) As Object

參數

service
Type

要擷取服務的 TypeThe Type of the service to retrieve.

傳回

實作所要求之服務的 Object,或 null (如果無法解析服務)。An Object that implements the requested service, or null if the service cannot be resolved.

備註

這個方法會覆Container.GetService寫方法。This method overrides the Container.GetService method. 這個執行只會解析和INestedContainer IContainer服務的要求。This implementation only resolves requests for the INestedContainer and IContainer services.

適用於

另請參閱