|
| 1 | +// Metadata.xml XPath interface reference: path="/api/package[@name='com.xamarin.android']/interface[@name='Parent']" |
| 2 | +[Register ("com/xamarin/android/Parent", "", "Com.Xamarin.Android.IParentInvoker")] |
| 3 | +public partial interface IParent : IJavaObject, IJavaPeerable { |
| 4 | + |
| 5 | + int Bar { |
| 6 | + // Metadata.xml XPath method reference: path="/api/package[@name='com.xamarin.android']/interface[@name='Parent']/method[@name='getBar' and count(parameter)=0]" |
| 7 | + [Register ("getBar", "()I", "GetGetBarHandler:Com.Xamarin.Android.IParentInvoker, MyAssembly")] get; |
| 8 | + } |
| 9 | + |
| 10 | + // Metadata.xml XPath class reference: path="/api/package[@name='com.xamarin.android']/class[@name='Parent.Child']" |
| 11 | + [global::Android.Runtime.Register ("com/xamarin/android/Parent$Child", DoNotGenerateAcw=true)] |
| 12 | + public partial class Child : Java.Lang.Object { |
| 13 | + |
| 14 | + static readonly JniPeerMembers _members = new JniPeerMembers ("com/xamarin/android/Parent$Child", typeof (Child)); |
| 15 | + internal static new IntPtr class_ref { |
| 16 | + get { |
| 17 | + return _members.JniPeerType.PeerReference.Handle; |
| 18 | + } |
| 19 | + } |
| 20 | + |
| 21 | + public override global::Java.Interop.JniPeerMembers JniPeerMembers { |
| 22 | + get { return _members; } |
| 23 | + } |
| 24 | + |
| 25 | + protected override IntPtr ThresholdClass { |
| 26 | + get { return _members.JniPeerType.PeerReference.Handle; } |
| 27 | + } |
| 28 | + |
| 29 | + protected override global::System.Type ThresholdType { |
| 30 | + get { return _members.ManagedPeerType; } |
| 31 | + } |
| 32 | + |
| 33 | + protected Child (IntPtr javaReference, JniHandleOwnership transfer) : base (javaReference, transfer) {} |
| 34 | + |
| 35 | + } |
| 36 | + |
| 37 | +} |
| 38 | + |
| 39 | +[global::Android.Runtime.Register ("com/xamarin/android/Parent", DoNotGenerateAcw=true)] |
| 40 | +internal partial class IParentInvoker : global::Java.Lang.Object, IParent { |
| 41 | + |
| 42 | + static readonly JniPeerMembers _members = new JniPeerMembers ("com/xamarin/android/Parent", typeof (IParentInvoker)); |
| 43 | + |
| 44 | + static IntPtr java_class_ref { |
| 45 | + get { return _members.JniPeerType.PeerReference.Handle; } |
| 46 | + } |
| 47 | + |
| 48 | + public override global::Java.Interop.JniPeerMembers JniPeerMembers { |
| 49 | + get { return _members; } |
| 50 | + } |
| 51 | + |
| 52 | + protected override IntPtr ThresholdClass { |
| 53 | + get { return class_ref; } |
| 54 | + } |
| 55 | + |
| 56 | + protected override global::System.Type ThresholdType { |
| 57 | + get { return _members.ManagedPeerType; } |
| 58 | + } |
| 59 | + |
| 60 | + new IntPtr class_ref; |
| 61 | + |
| 62 | + public static IParent GetObject (IntPtr handle, JniHandleOwnership transfer) |
| 63 | + { |
| 64 | + return global::Java.Lang.Object.GetObject<IParent> (handle, transfer); |
| 65 | + } |
| 66 | + |
| 67 | + static IntPtr Validate (IntPtr handle) |
| 68 | + { |
| 69 | + if (!JNIEnv.IsInstanceOf (handle, java_class_ref)) |
| 70 | + throw new InvalidCastException (string.Format ("Unable to convert instance of type '{0}' to type '{1}'.", |
| 71 | + JNIEnv.GetClassNameFromInstance (handle), "com.xamarin.android.Parent")); |
| 72 | + return handle; |
| 73 | + } |
| 74 | + |
| 75 | + protected override void Dispose (bool disposing) |
| 76 | + { |
| 77 | + if (this.class_ref != IntPtr.Zero) |
| 78 | + JNIEnv.DeleteGlobalRef (this.class_ref); |
| 79 | + this.class_ref = IntPtr.Zero; |
| 80 | + base.Dispose (disposing); |
| 81 | + } |
| 82 | + |
| 83 | + public IParentInvoker (IntPtr handle, JniHandleOwnership transfer) : base (Validate (handle), transfer) |
| 84 | + { |
| 85 | + IntPtr local_ref = JNIEnv.GetObjectClass (((global::Java.Lang.Object) this).Handle); |
| 86 | + this.class_ref = JNIEnv.NewGlobalRef (local_ref); |
| 87 | + JNIEnv.DeleteLocalRef (local_ref); |
| 88 | + } |
| 89 | + |
| 90 | + static Delegate cb_getBar; |
| 91 | +#pragma warning disable 0169 |
| 92 | + static Delegate GetGetBarHandler () |
| 93 | + { |
| 94 | + if (cb_getBar == null) |
| 95 | + cb_getBar = JNINativeWrapper.CreateDelegate ((Func<IntPtr, IntPtr, int>) n_GetBar); |
| 96 | + return cb_getBar; |
| 97 | + } |
| 98 | + |
| 99 | + static int n_GetBar (IntPtr jnienv, IntPtr native__this) |
| 100 | + { |
| 101 | + Com.Xamarin.Android.IParent __this = global::Java.Lang.Object.GetObject<Com.Xamarin.Android.IParent> (jnienv, native__this, JniHandleOwnership.DoNotTransfer); |
| 102 | + return __this.Bar; |
| 103 | + } |
| 104 | +#pragma warning restore 0169 |
| 105 | + |
| 106 | + IntPtr id_getBar; |
| 107 | + public unsafe int Bar { |
| 108 | + get { |
| 109 | + if (id_getBar == IntPtr.Zero) |
| 110 | + id_getBar = JNIEnv.GetMethodID (class_ref, "getBar", "()I"); |
| 111 | + return JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_getBar); |
| 112 | + } |
| 113 | + } |
| 114 | + |
| 115 | +} |
| 116 | + |
0 commit comments