HierarchyProvider.GetService(Type) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
要求したサービスを取得します。
protected:
System::Object ^ GetService(Type ^ serviceType);
protected object GetService (Type serviceType);
member this.GetService : Type -> obj
Protected Function GetService (serviceType As Type) As Object
パラメーター
- serviceType
- Type
Type要求されたIServiceProviderインターフェイスの オブジェクト。
戻り値
要求されたサービス オブジェクト。または null
サービスが存在しない場合は 。
実装
例
次の例では、 メソッドを GetService 使用してナビゲーション サービスを取得します。
bool OnMySelection() {
INavigationService ns = (INavigationService)
GetService(typeof(INavigationService));
if (Parent.Properties == null)
return false;
ManagementConfigurationPath configPath =
(ManagementConfigurationPath)Parent.Properties["ConfigurationPath"];
return ns.Navigate(Connection, configPath,
typeof(DemoPage), null);
}