ExportLifetimeContext<T> 类

定义

保存由 ExportFactory<T> 对象创建的导出值,以及对释放该对象的方法的引用。

generic <typename T>
public ref class ExportLifetimeContext sealed : IDisposable
public sealed class ExportLifetimeContext<T> : IDisposable
type ExportLifetimeContext<'T> = class
    interface IDisposable
Public NotInheritable Class ExportLifetimeContext(Of T)
Implements IDisposable

类型参数

T

导出值的类型。

继承
ExportLifetimeContext<T>
实现

注解

Important

此类型实现 IDisposable 接口。 使用完类型后,应直接(通过调用其 Dispose 方法)或间接(使用 C# 等 using 语言构造)将其释放。 有关详细信息,请参阅 使用实现 IDisposable 的对象

构造函数

名称 说明
ExportLifetimeContext<T>(T, Action)

初始化 ExportLifetimeContext<T> 类的新实例。

属性

名称 说明
Value

获取对象的导出值 ExportFactory<T>

方法

名称 说明
Dispose()

释放类的 ExportLifetimeContext<T> 当前实例使用的所有资源,包括其关联的导出。

Equals(Object)

确定指定的对象是否等于当前对象。

(继承自 Object)
GetHashCode()

用作默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object的浅表副本。

(继承自 Object)
ToString()

返回一个表示当前对象的字符串。

(继承自 Object)

适用于