StringReader.Dispose(Boolean) 方法

定義

釋放 StringReader 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。Releases the unmanaged resources used by the StringReader and optionally releases the managed resources.

protected:
 override void Dispose(bool disposing);
protected override void Dispose (bool disposing);
override this.Dispose : bool -> unit
Protected Overrides Sub Dispose (disposing As Boolean)

參數

disposing
Boolean

true 表示釋放 Managed 和 Unmanaged 資源,false 則表示只釋放 Unmanaged 資源。true to release both managed and unmanaged resources; false to release only unmanaged resources.

備註

disposing 參數為 true 時,這個方法會釋放 StringReader 參考的任何 Managed 物件所掌握的資源。When the disposing parameter is true, this method releases all resources held by any managed objects that this StringReader references. 這個方法會叫用每個參考物件的 Dispose 方法。This method invokes the Dispose method of each referenced object.

給繼承者的注意事項

Dispose(Boolean) 可以被其他物件呼叫多次。 Dispose(Boolean) can be called multiple times by other objects. 覆寫 Dispose(Boolean)時,請小心不要參考先前已在先前的呼叫中處置 Dispose(Boolean)的物件。When overriding Dispose(Boolean), be careful not to reference objects that have been previously disposed in an earlier call to Dispose(Boolean).

適用於

另請參閱