IComponentModel.GetService<T> 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
从默认的组合容器中获取 "服务",即,给定组合容器中只能存在一个实例的对象。 等于直接调用 GetExportedValue<T>() 。
public:
generic <typename T>
where T : class T GetService();
public:
generic <typename T>
where T : class T GetService();
template <typename T>
where T : class T GetService();
public T GetService<T> () where T : class;
abstract member GetService : unit -> 'T (requires 'T : null)
Public Function GetService(Of T As Class) () As T
类型参数
- T
要获取的对象类型。
返回
- T
所请求的对象的实例。