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>
實作

備註

重要

此型別代表 IDisposable 介面。 當您完成使用型別時,您應該直接或間接處置它。 若要直接處置型別,請呼叫其 try/catch 區塊中的 Dispose 方法。 若要間接處置它,請使用語言建構函式,例如 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)

適用於