static void n_OnAdd(IntPtr jnienv, IntPtr lrefThis, IntPtr values, int currentIndex, int currentSum) { IAdderProgress __this = Java.Lang.Object.GetObject <IAdderProgress>(lrefThis, JniHandleOwnership.DoNotTransfer); using (var _values = new JavaArray <int>(values, JniHandleOwnership.DoNotTransfer)) { __this.OnAdd(_values, currentIndex, currentSum); } }
public static int Sum(Adder self, IAdderProgress progress, params int[] values) { if (id_ssum == IntPtr.Zero) { id_ssum = JNIEnv.GetStaticMethodID(class_ref, "sum", "(Lmono/android/test/Adder;Lmono/android/test/Adder$Progress;[I)I"); } IntPtr native_values = JNIEnv.NewArray(values); try { return(JNIEnv.CallStaticIntMethod(class_ref, id_ssum, new JValue(JNIEnv.ToJniHandle(self)), new JValue(JNIEnv.ToJniHandle(progress)), new JValue(native_values))); } finally { JNIEnv.DeleteLocalRef(native_values); } }