ExportLifetimeContext<T> ExportLifetimeContext<T> ExportLifetimeContext<T> ExportLifetimeContext<T> Class


保留 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



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




此類型會實作IDisposable介面。This type implements the IDisposable interface. 當您完成使用型別時,您應該處置它直接或間接。When you have finished using the type, you should dispose of it either directly or indirectly. 若要直接處置型別,呼叫其Dispose方法中的try / catch區塊。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>(T, Action) ExportLifetimeContext<T>(T, Action) ExportLifetimeContext<T>(T, Action)

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


Value Value Value Value

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


Dispose() Dispose() Dispose() Dispose()

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

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

(Inherited from Object)
ToString() ToString() ToString() ToString()

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

(Inherited from Object)