HierarchyInfo.GetService(Type) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
指定した型のサービス オブジェクトを取得します。
protected:
System::Object ^ GetService(Type ^ type);
protected object GetService (Type type);
member this.GetService : Type -> obj
パラメーター
- type
- Type
取得対象となるサービスの型を指定するオブジェクト。
戻り値
パラメーターで type
指定された型のサービス オブジェクト。型 null
の type
サービス オブジェクトがない場合は 。
実装
例
次の例では、 メソッドを GetService 使用して オブジェクトを Connection 取得します。
protected override Connection Connection
{
get
{
Connection connection = (Connection)GetService(typeof(Connection));
return connection;
}
}