using System;
using System.Collections.Generic;
using Android.Runtime;
using Java.Interop;

namespace Com.Uhf.Api.Cls {

	// Metadata.xml XPath class reference: path="/api/package[@name='com.uhf.api.cls']/class[@name='R2000WriteFlashSendData']"
	[global::Android.Runtime.Register ("com/uhf/api/cls/R2000WriteFlashSendData", DoNotGenerateAcw=true)]
	public partial class R2000WriteFlashSendData : global::Java.Lang.Object {
		static readonly JniPeerMembers _members = new XAPeerMembers ("com/uhf/api/cls/R2000WriteFlashSendData", typeof (R2000WriteFlashSendData));

		internal static IntPtr class_ref {
			get { return _members.JniPeerType.PeerReference.Handle; }
		}

		[global::System.Diagnostics.DebuggerBrowsable (global::System.Diagnostics.DebuggerBrowsableState.Never)]
		[global::System.ComponentModel.EditorBrowsable (global::System.ComponentModel.EditorBrowsableState.Never)]
		public override global::Java.Interop.JniPeerMembers JniPeerMembers {
			get { return _members; }
		}

		[global::System.Diagnostics.DebuggerBrowsable (global::System.Diagnostics.DebuggerBrowsableState.Never)]
		[global::System.ComponentModel.EditorBrowsable (global::System.ComponentModel.EditorBrowsableState.Never)]
		protected override IntPtr ThresholdClass {
			get { return _members.JniPeerType.PeerReference.Handle; }
		}

		[global::System.Diagnostics.DebuggerBrowsable (global::System.Diagnostics.DebuggerBrowsableState.Never)]
		[global::System.ComponentModel.EditorBrowsable (global::System.ComponentModel.EditorBrowsableState.Never)]
		protected override global::System.Type ThresholdType {
			get { return _members.ManagedPeerType; }
		}

		protected R2000WriteFlashSendData (IntPtr javaReference, JniHandleOwnership transfer) : base (javaReference, transfer)
		{
		}

		// Metadata.xml XPath constructor reference: path="/api/package[@name='com.uhf.api.cls']/class[@name='R2000WriteFlashSendData']/constructor[@name='R2000WriteFlashSendData' and count(parameter)=3 and parameter[1][@type='int'] and parameter[2][@type='int'] and parameter[3][@type='byte[]']]"
		[Register (".ctor", "(II[B)V", "")]
		public unsafe R2000WriteFlashSendData (int wflag, int address, byte[] flashdata) : base (IntPtr.Zero, JniHandleOwnership.DoNotTransfer)
		{
			const string __id = "(II[B)V";

			if (((global::Java.Lang.Object) this).Handle != IntPtr.Zero)
				return;

			IntPtr native_flashdata = JNIEnv.NewArray (flashdata);
			try {
				JniArgumentValue* __args = stackalloc JniArgumentValue [3];
				__args [0] = new JniArgumentValue (wflag);
				__args [1] = new JniArgumentValue (address);
				__args [2] = new JniArgumentValue (native_flashdata);
				var __r = _members.InstanceMethods.StartCreateInstance (__id, ((object) this).GetType (), __args);
				SetHandle (__r.Handle, JniHandleOwnership.TransferLocalRef);
				_members.InstanceMethods.FinishCreateInstance (__id, this, __args);
			} finally {
				if (flashdata != null) {
					JNIEnv.CopyArray (native_flashdata, flashdata);
					JNIEnv.DeleteLocalRef (native_flashdata);
				}
				global::System.GC.KeepAlive (flashdata);
			}
		}

		static Delegate cb_To_CmdData;
#pragma warning disable 0169
		static Delegate GetTo_CmdDataHandler ()
		{
			if (cb_To_CmdData == null)
				cb_To_CmdData = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_To_CmdData);
			return cb_To_CmdData;
		}

		static IntPtr n_To_CmdData (IntPtr jnienv, IntPtr native__this)
		{
			var __this = global::Java.Lang.Object.GetObject<global::Com.Uhf.Api.Cls.R2000WriteFlashSendData> (jnienv, native__this, JniHandleOwnership.DoNotTransfer);
			return JNIEnv.NewArray (__this.To_CmdData ());
		}
#pragma warning restore 0169

		// Metadata.xml XPath method reference: path="/api/package[@name='com.uhf.api.cls']/class[@name='R2000WriteFlashSendData']/method[@name='To_CmdData' and count(parameter)=0]"
		[Register ("To_CmdData", "()[B", "GetTo_CmdDataHandler")]
		public virtual unsafe byte[] To_CmdData ()
		{
			const string __id = "To_CmdData.()[B";
			try {
				var __rm = _members.InstanceMethods.InvokeVirtualObjectMethod (__id, this, null);
				return (byte[]) JNIEnv.GetArray (__rm.Handle, JniHandleOwnership.TransferLocalRef, typeof (byte));
			} finally {
			}
		}

	}
}
