DataGridView.Dispose 方法 (Boolean)
釋放 DataGridView 所使用的 Unmanaged 資源,並選擇性釋放 Managed 資源。
命名空間: Microsoft.Office.Tools.Word.Controls
組件: Microsoft.Office.Tools.Word.v4.0.Utilities (在 Microsoft.Office.Tools.Word.v4.0.Utilities.dll 中)
語法
'宣告
Protected Overrides Sub Dispose ( _
disposing As Boolean _
)
protected override void Dispose(
bool disposing
)
參數
- disposing
類型:System.Boolean
true 表示會同時釋放 Managed 和 Unmanaged 資源,false 則表示只釋放 Unmanaged 資源。
備註
This method is called by the public Dispose method and the Finalize method. Dispose() invokes the protected Dispose(Boolean) method with the disposing parameter set to true. Finalize invokes Dispose with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this DataGridView references. This method invokes the Dispose() method of each referenced object.
繼承者注意事項
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects that have been previously disposed of in an earlier call to Dispose. For more information about how to implement Dispose(Boolean), see 實作 Dispose 方法.
For more information about Dispose and Finalize, see 清除 Unmanaged 資源.
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱 從部分受信任程式碼使用程式庫。