次の方法で共有


HierarchyInfo.GetService(Type) メソッド

定義

指定した型のサービス オブジェクトを取得します。

protected:
 System::Object ^ GetService(Type ^ type);
protected object GetService (Type type);
member this.GetService : Type -> obj

パラメーター

type
Type

取得対象となるサービスの型を指定するオブジェクト。

戻り値

パラメーターで type 指定された型のサービス オブジェクト。型 nulltypeサービス オブジェクトがない場合は 。

実装

次の例では、 メソッドを GetService 使用して オブジェクトを Connection 取得します。

protected override Connection Connection
{
    get
    {
        Connection connection = (Connection)GetService(typeof(Connection));
        return connection;
    }
}

適用対象