CachedDataItemEnumerator.IDisposable.Dispose 方法

釋放 CachedDataItemEnumerator 使用的所有資源。

命名空間:  Microsoft.VisualStudio.Tools.Applications
組件:  Microsoft.VisualStudio.Tools.Applications.ServerDocument (在 Microsoft.VisualStudio.Tools.Applications.ServerDocument.dll 中)

語法

'宣告
Private Sub Dispose Implements IDisposable.Dispose
void IDisposable.Dispose()

實作

IDisposable.Dispose()

備註

CachedDataItemEnumerator 使用完畢後,請呼叫 IDisposable.Dispose。 IDisposable.Dispose 方法讓 CachedDataItemEnumerator 處於無法使用的狀態。 在呼叫 IDisposable.Dispose 後,您必須釋放所有對 CachedDataItemEnumerator 的參考,讓記憶體回收行程可以回收 CachedDataItemEnumerator 佔用的記憶體。 如需詳細資訊,請參閱清除 Unmanaged 資源實作 Dispose 方法

注意事項注意事項

在您釋放對 CachedDataItemEnumerator 的最後參考之前,一定要呼叫 IDisposable.Dispose。 否則,將不會釋放它正使用的資源,直到記憶體回收行程呼叫 CachedDataItemEnumerator 物件的 Finalize 方法。

這個方法是明確介面成員實作。 只有在 CachedDataItemEnumerator 執行個體轉換成 IDisposable 介面時,才能使用這個成員。

.NET Framework 安全性

請參閱

參考

CachedDataItemEnumerator 類別

Microsoft.VisualStudio.Tools.Applications 命名空間