Language

JniRuntime.JniValueManager.TryConstructPeer Method

Definition

Invokes an activation constructor on an existing managed peer when one is found.

protected virtual bool TryConstructPeer(Java.Interop.IJavaPeerable self, ref Java.Interop.JniObjectReference reference, Java.Interop.JniObjectReferenceOptions options, Type type);
abstract member TryConstructPeer : Java.Interop.IJavaPeerable * JniObjectReference * Java.Interop.JniObjectReferenceOptions * Type -> bool
override this.TryConstructPeer : Java.Interop.IJavaPeerable * JniObjectReference * Java.Interop.JniObjectReferenceOptions * Type -> bool

Parameters

self
IJavaPeerable

The already allocated managed peer to initialize.

reference
JniObjectReference

The JNI reference passed to the activation constructor and updated from its by-reference argument.

options
JniObjectReferenceOptions

Reference-transfer options passed to the activation constructor.

type
Type

The type whose public or non-public activation constructor is searched.

Returns

true if the constructor was invoked; false if no matching constructor exists.

Remarks

The constructor signature is (ref JniObjectReference, JniObjectReferenceOptions). Reflection invocation exceptions propagate.

Applies to