Xamarin绑定库错误"没有实现继承的抽象成员"即使它被实施了

时间:2015-07-20 01:39:57

标签: c# binding xamarin implementation

我从Java绑定了一个Xamarin库。但是当我构建它时,我遇到了这个问题。

  

错误42' Com.Almeros.Android.Multitouch.RotateGestureDetector'不   没有实现继承的抽象成员   ' Com.Almeros.Android.Multitouch.BaseGestureDetector.HandleInProgressEvent(INT,   Android.Views.MotionEvent)'

即使我有这个功能

static IntPtr id_handleInProgressEvent_ILandroid_view_MotionEvent_;
        // Metadata.xml XPath method reference: path="/api/package[@name='com.almeros.android.multitouch']/class[@name='RotateGestureDetector']/method[@name='handleInProgressEvent' and count(parameter)=2 and parameter[1][@type='int'] and parameter[2][@type='android.view.MotionEvent']]"
        [Register ("handleInProgressEvent", "(ILandroid/view/MotionEvent;)V", "GetHandleInProgressEvent_ILandroid_view_MotionEvent_Handler")]
        protected override unsafe void HandleInProgressEvent (int p0, global::Android.Views.MotionEvent p1)
        {
            if (id_handleInProgressEvent_ILandroid_view_MotionEvent_ == IntPtr.Zero)
                id_handleInProgressEvent_ILandroid_view_MotionEvent_ = JNIEnv.GetMethodID (class_ref, "handleInProgressEvent", "(ILandroid/view/MotionEvent;)V");
            try {
                JValue* __args = stackalloc JValue [2];
                __args [0] = new JValue (p0);
                __args [1] = new JValue (p1);

                if (GetType () == ThresholdType)
                    JNIEnv.CallVoidMethod  (Handle, id_handleInProgressEvent_ILandroid_view_MotionEvent_, __args);
                else
                    JNIEnv.CallNonvirtualVoidMethod  (Handle, ThresholdClass, JNIEnv.GetMethodID (ThresholdClass, "handleInProgressEvent", "(ILandroid/view/MotionEvent;)V"), __args);
            } finally {
            }
        }

===============

我尝试实现该功能,但我收到了另一个错误

  

错误1键入' Com.Almeros.Android.Multitouch.RotateGestureDetector'   已经定义了一个名为' HandleInProgressEvent'与此相同   参数类型

public partial class RotateGestureDetector : global::Com.Almeros.Android.Multitouch.TwoFingerGestureDetector
    {
        protected override void HandleInProgressEvent(int p0, MotionEvent p1)
        {
            throw new NotImplementedException();
        }
    }

0 个答案:

没有答案