|
| 1 | +// Metadata.xml XPath class reference: path="/api/package[@name='com.example']/class[@name='MyClass']" |
| 2 | +[global::Android.Runtime.Register ("com/example/MyClass", DoNotGenerateAcw=true)] |
| 3 | +public partial class MyClass : Java.Lang.Object { |
| 4 | + static readonly JniPeerMembers _members = new XAPeerMembers ("com/example/MyClass", typeof (MyClass)); |
| 5 | + |
| 6 | + internal static new IntPtr class_ref { |
| 7 | + get { return _members.JniPeerType.PeerReference.Handle; } |
| 8 | + } |
| 9 | + |
| 10 | + [global::System.Diagnostics.DebuggerBrowsable (global::System.Diagnostics.DebuggerBrowsableState.Never)] |
| 11 | + [global::System.ComponentModel.EditorBrowsable (global::System.ComponentModel.EditorBrowsableState.Never)] |
| 12 | + public override global::Java.Interop.JniPeerMembers JniPeerMembers { |
| 13 | + get { return _members; } |
| 14 | + } |
| 15 | + |
| 16 | + [global::System.Diagnostics.DebuggerBrowsable (global::System.Diagnostics.DebuggerBrowsableState.Never)] |
| 17 | + [global::System.ComponentModel.EditorBrowsable (global::System.ComponentModel.EditorBrowsableState.Never)] |
| 18 | + protected override IntPtr ThresholdClass { |
| 19 | + get { return _members.JniPeerType.PeerReference.Handle; } |
| 20 | + } |
| 21 | + |
| 22 | + [global::System.Diagnostics.DebuggerBrowsable (global::System.Diagnostics.DebuggerBrowsableState.Never)] |
| 23 | + [global::System.ComponentModel.EditorBrowsable (global::System.ComponentModel.EditorBrowsableState.Never)] |
| 24 | + protected override global::System.Type ThresholdType { |
| 25 | + get { return _members.ManagedPeerType; } |
| 26 | + } |
| 27 | + |
| 28 | + protected MyClass (IntPtr javaReference, JniHandleOwnership transfer) : base (javaReference, transfer) |
| 29 | + { |
| 30 | + } |
| 31 | + |
| 32 | + static Delegate? cb_echo_arrayLjava_lang_CharSequence_; |
| 33 | +#pragma warning disable 0169 |
| 34 | + static Delegate GetEcho_arrayLjava_lang_CharSequence_Handler () |
| 35 | + { |
| 36 | + if (cb_echo_arrayLjava_lang_CharSequence_ == null) |
| 37 | + cb_echo_arrayLjava_lang_CharSequence_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_L) n_Echo_arrayLjava_lang_CharSequence_); |
| 38 | + return cb_echo_arrayLjava_lang_CharSequence_; |
| 39 | + } |
| 40 | + |
| 41 | + static IntPtr n_Echo_arrayLjava_lang_CharSequence_ (IntPtr jnienv, IntPtr native__this, IntPtr native_messages) |
| 42 | + { |
| 43 | + var __this = global::Java.Lang.Object.GetObject<Com.Example.MyClass> (jnienv, native__this, JniHandleOwnership.DoNotTransfer)!; |
| 44 | + var messages = (Java.Lang.ICharSequence[]?) JNIEnv.GetArray (native_messages, JniHandleOwnership.DoNotTransfer, typeof (Java.Lang.ICharSequence)); |
| 45 | + IntPtr __ret = JNIEnv.NewArray (__this.EchoFormatted (messages)); |
| 46 | + if (messages != null) |
| 47 | + JNIEnv.CopyArray (messages, native_messages); |
| 48 | + return __ret; |
| 49 | + } |
| 50 | +#pragma warning restore 0169 |
| 51 | + |
| 52 | + // Metadata.xml XPath method reference: path="/api/package[@name='com.example']/class[@name='MyClass']/method[@name='echo' and count(parameter)=1 and parameter[1][@type='java.lang.CharSequence[]']]" |
| 53 | + [Register ("echo", "([Ljava/lang/CharSequence;)[Ljava/lang/CharSequence;", "GetEcho_arrayLjava_lang_CharSequence_Handler")] |
| 54 | + public virtual unsafe Java.Lang.ICharSequence[]? EchoFormatted (Java.Lang.ICharSequence[]? messages) |
| 55 | + { |
| 56 | + const string __id = "echo.([Ljava/lang/CharSequence;)[Ljava/lang/CharSequence;"; |
| 57 | + IntPtr native_messages = JNIEnv.NewArray (messages); |
| 58 | + try { |
| 59 | + JniArgumentValue* __args = stackalloc JniArgumentValue [1]; |
| 60 | + __args [0] = new JniArgumentValue (native_messages); |
| 61 | + var __rm = _members.InstanceMethods.InvokeVirtualObjectMethod (__id, this, __args); |
| 62 | + return (Java.Lang.ICharSequence[]?) JNIEnv.GetArray (__rm.Handle, JniHandleOwnership.TransferLocalRef, typeof (Java.Lang.ICharSequence)); |
| 63 | + } finally { |
| 64 | + if (messages != null) { |
| 65 | + JNIEnv.CopyArray (native_messages, messages); |
| 66 | + JNIEnv.DeleteLocalRef (native_messages); |
| 67 | + } |
| 68 | + global::System.GC.KeepAlive (messages); |
| 69 | + } |
| 70 | + } |
| 71 | + |
| 72 | + public string[]? Echo (string[]? messages) |
| 73 | + { |
| 74 | + var jlca_messages = CharSequence.ArrayFromStringArray (messages); |
| 75 | + Java.Lang.ICharSequence[]? __result = EchoFormatted (jlca_messages); |
| 76 | + var __rsval = CharSequence.ArrayToStringArray (__result); |
| 77 | + if (jlca_messages != null) foreach (var s in jlca_messages) s?.Dispose (); |
| 78 | + return __rsval; |
| 79 | + } |
| 80 | + |
| 81 | +} |
0 commit comments