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 接口。 使用完该类型后,应直接或间接处理它。 若要直接释放类型,请在块中Disposetry/调用其catch方法。 若要间接释放它,请使用语言构造,例如 using (在 C# 中)或 Using (在 Visual Basic 中)。 有关详细信息,请参阅接口主题中的 IDisposable “使用实现 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)

适用于