ExportLifetimeContext<T> 類別

定義

保留 ExportFactory<T> 物件建立的匯出值及方法的參考,以釋放該物件。Holds an exported value created by an ExportFactory<T> object and a reference to a method to release that object.

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

匯出值的型別。The type of the exported value.

繼承
ExportLifetimeContext<T>
實作

備註

重要

此型別代表 IDisposable 介面。This type implements the IDisposable interface. 當您完成使用型別時,您應該直接或間接處置它。When you have finished using the type, you should dispose of it either directly or indirectly. 若要直接處置型別,請呼叫其 try/catch 區塊中的 Dispose 方法。To dispose of the type directly, call its Dispose method in a try/catch block. 若要間接處置它,請使用語言建構函式,例如 using (在 C# 中) 或 Using (在 Visual Basic 中)。To dispose of it indirectly, use a language construct such as using (in C#) or Using (in Visual Basic). 如需詳細資訊,請參閱 IDisposable 介面文章中的<使用實作 IDisposable 的物件>一節。For more information, see the "Using an Object that Implements IDisposable" section in the IDisposable interface topic.

建構函式

ExportLifetimeContext<T>(T, Action)

初始化 ExportLifetimeContext<T> 類別的新執行個體。Initializes a new instance of the ExportLifetimeContext<T> class.

屬性

Value

取得 ExportFactory<T> 物件的匯出值。Gets the exported value of a ExportFactory<T> object.

方法

Dispose()

ExportLifetimeContext<T> 類別目前的執行個體所使用的資源全部釋出,包括其相關聯的匯出。Releases all resources used by the current instance of the ExportLifetimeContext<T> class, including its associated export.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於