|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using Android.Runtime; |
| 4 | + |
| 5 | +// Metadata.xml XPath class reference: path="/api/package[@name='']/class[@name='ClassWithoutNamespace']" |
| 6 | +[global::Android.Runtime.Register ("ClassWithoutNamespace", DoNotGenerateAcw=true)] |
| 7 | +public abstract partial class ClassWithoutNamespace : global::Java.Lang.Object, IInterfaceWithoutNamespace { |
| 8 | + |
| 9 | + internal static new IntPtr java_class_handle; |
| 10 | + internal static new IntPtr class_ref { |
| 11 | + get { |
| 12 | + return JNIEnv.FindClass ("ClassWithoutNamespace", ref java_class_handle); |
| 13 | + } |
| 14 | + } |
| 15 | + |
| 16 | + protected override IntPtr ThresholdClass { |
| 17 | + get { return class_ref; } |
| 18 | + } |
| 19 | + |
| 20 | + protected override global::System.Type ThresholdType { |
| 21 | + get { return typeof (ClassWithoutNamespace); } |
| 22 | + } |
| 23 | + |
| 24 | + protected ClassWithoutNamespace (IntPtr javaReference, JniHandleOwnership transfer) : base (javaReference, transfer) {} |
| 25 | + |
| 26 | + static IntPtr id_ctor; |
| 27 | + // Metadata.xml XPath constructor reference: path="/api/package[@name='']/class[@name='ClassWithoutNamespace']/constructor[@name='ClassWithoutNamespace' and count(parameter)=0]" |
| 28 | + [Register (".ctor", "()V", "")] |
| 29 | + public unsafe ClassWithoutNamespace () |
| 30 | + : base (IntPtr.Zero, JniHandleOwnership.DoNotTransfer) |
| 31 | + { |
| 32 | + if (((global::Java.Lang.Object) this).Handle != IntPtr.Zero) |
| 33 | + return; |
| 34 | + |
| 35 | + try { |
| 36 | + if (((object) this).GetType () != typeof (ClassWithoutNamespace)) { |
| 37 | + SetHandle ( |
| 38 | + global::Android.Runtime.JNIEnv.StartCreateInstance (((object) this).GetType (), "()V"), |
| 39 | + JniHandleOwnership.TransferLocalRef); |
| 40 | + global::Android.Runtime.JNIEnv.FinishCreateInstance (((global::Java.Lang.Object) this).Handle, "()V"); |
| 41 | + return; |
| 42 | + } |
| 43 | + |
| 44 | + if (id_ctor == IntPtr.Zero) |
| 45 | + id_ctor = JNIEnv.GetMethodID (class_ref, "<init>", "()V"); |
| 46 | + SetHandle ( |
| 47 | + global::Android.Runtime.JNIEnv.StartCreateInstance (class_ref, id_ctor), |
| 48 | + JniHandleOwnership.TransferLocalRef); |
| 49 | + JNIEnv.FinishCreateInstance (((global::Java.Lang.Object) this).Handle, class_ref, id_ctor); |
| 50 | + } finally { |
| 51 | + } |
| 52 | + } |
| 53 | + |
| 54 | + static Delegate cb_Foo; |
| 55 | +#pragma warning disable 0169 |
| 56 | + static Delegate GetFooHandler () |
| 57 | + { |
| 58 | + if (cb_Foo == null) |
| 59 | + cb_Foo = JNINativeWrapper.CreateDelegate ((Action<IntPtr, IntPtr>) n_Foo); |
| 60 | + return cb_Foo; |
| 61 | + } |
| 62 | + |
| 63 | + static void n_Foo (IntPtr jnienv, IntPtr native__this) |
| 64 | + { |
| 65 | + ClassWithoutNamespace __this = global::Java.Lang.Object.GetObject<ClassWithoutNamespace> (jnienv, native__this, JniHandleOwnership.DoNotTransfer); |
| 66 | + __this.Foo (); |
| 67 | + } |
| 68 | +#pragma warning restore 0169 |
| 69 | + |
| 70 | + // Metadata.xml XPath method reference: path="/api/package[@name='']/interface[@name='InterfaceWithoutNamespace']/method[@name='Foo' and count(parameter)=0]" |
| 71 | + [Register ("Foo", "()V", "GetFooHandler")] |
| 72 | + public abstract void Foo (); |
| 73 | + |
| 74 | +} |
| 75 | + |
| 76 | +[global::Android.Runtime.Register ("ClassWithoutNamespace", DoNotGenerateAcw=true)] |
| 77 | +internal partial class ClassWithoutNamespaceInvoker : ClassWithoutNamespace { |
| 78 | + |
| 79 | + public ClassWithoutNamespaceInvoker (IntPtr handle, JniHandleOwnership transfer) : base (handle, transfer) {} |
| 80 | + |
| 81 | + protected override global::System.Type ThresholdType { |
| 82 | + get { return typeof (ClassWithoutNamespaceInvoker); } |
| 83 | + } |
| 84 | + |
| 85 | + static IntPtr id_Foo; |
| 86 | + // Metadata.xml XPath method reference: path="/api/package[@name='']/interface[@name='InterfaceWithoutNamespace']/method[@name='Foo' and count(parameter)=0]" |
| 87 | + [Register ("Foo", "()V", "GetFooHandler")] |
| 88 | + public override unsafe void Foo () |
| 89 | + { |
| 90 | + if (id_Foo == IntPtr.Zero) |
| 91 | + id_Foo = JNIEnv.GetMethodID (class_ref, "Foo", "()V"); |
| 92 | + try { |
| 93 | + JNIEnv.CallVoidMethod (((global::Java.Lang.Object) this).Handle, id_Foo); |
| 94 | + } finally { |
| 95 | + } |
| 96 | + } |
| 97 | + |
| 98 | +} |
| 99 | + |
0 commit comments