Share via


IJavaPeerable.Disposed Method

Definition

Called when the instance has been disposed.

public void Disposed();
abstract member Disposed : unit -> unit

Remarks

The Disposed method is invoked after the Dispose() method has been invoked on the instance. The PeerReference property is still valid when Disposed is invoked.

<block subset="none" type="usage"> This method should only be invoked by the JniRuntime instance which will be managing the IJavaPeerable value. </block> <block subset="none" type="overrides">

If the type is following the typical IDisposable pattern, then the Disposed method should delegate to the Dispose(bool) method. The proscribed implementation template is:

[JniTypeSignature ("my/Example")]
partial class ExampleBinding : IJavaPeerable {

	public void Dispose ()
	{
        JniEnvironment.Runtime.ValueManager.Dispose (this);
	}

	protected virtual void Dispose (bool disposing)
	{
	}

	void IJavaPeerable.Disposed ()
	{
	    Dispose (disposing: true);
	}
}

</block>

Applies to