GetMethodID() public static method

public static GetMethodID ( IntPtr obj, string name, string sig ) : IntPtr
obj System.IntPtr
name string
sig string
return System.IntPtr
Ejemplo n.º 1
0
        public static IntPtr GetMethodID(IntPtr jclass, string methodName, string signature, bool isStatic)
        {
            IntPtr ptr3;
            IntPtr zero = IntPtr.Zero;

            try
            {
                zero = AndroidReflection.GetMethodMember(jclass, methodName, signature, isStatic);
                ptr3 = AndroidJNISafe.FromReflectedMethod(zero);
            }
            catch (Exception exception)
            {
                IntPtr ptr2 = !isStatic?AndroidJNISafe.GetMethodID(jclass, methodName, signature) : AndroidJNISafe.GetStaticMethodID(jclass, methodName, signature);

                if (ptr2 == IntPtr.Zero)
                {
                    throw exception;
                }
                return(ptr2);
            }
            finally
            {
                AndroidJNISafe.DeleteLocalRef(zero);
            }
            return(ptr3);
        }
Ejemplo n.º 2
0
        public static IntPtr GetConstructorID(IntPtr jclass, string signature)
        {
            IntPtr ptr3;
            IntPtr zero = IntPtr.Zero;

            try
            {
                zero = AndroidReflection.GetConstructorMember(jclass, signature);
                ptr3 = AndroidJNISafe.FromReflectedMethod(zero);
            }
            catch (Exception exception)
            {
                IntPtr ptr2 = AndroidJNISafe.GetMethodID(jclass, "<init>", signature);
                if (ptr2 == IntPtr.Zero)
                {
                    throw exception;
                }
                return(ptr2);
            }
            finally
            {
                AndroidJNISafe.DeleteLocalRef(zero);
            }
            return(ptr3);
        }
Ejemplo n.º 3
0
        public static IntPtr GetConstructorID(IntPtr jclass, string signature)
        {
            IntPtr intPtr = IntPtr.Zero;
            IntPtr result;

            try
            {
                intPtr = AndroidReflection.GetConstructorMember(jclass, signature);
                result = AndroidJNISafe.FromReflectedMethod(intPtr);
            }
            catch (Exception ex)
            {
                IntPtr methodID = AndroidJNISafe.GetMethodID(jclass, "<init>", signature);
                if (!(methodID != IntPtr.Zero))
                {
                    throw ex;
                }
                result = methodID;
            }
            finally
            {
                AndroidJNISafe.DeleteLocalRef(intPtr);
            }
            return(result);
        }
        public static IntPtr GetMethodID(IntPtr jclass, string methodName, string signature, bool isStatic)
        {
            IntPtr intPtr = IntPtr.Zero;
            IntPtr result;

            try
            {
                intPtr = AndroidReflection.GetMethodMember(jclass, methodName, signature, isStatic);
                result = AndroidJNISafe.FromReflectedMethod(intPtr);
            }
            catch (Exception ex)
            {
                IntPtr intPtr2 = (!isStatic) ? AndroidJNISafe.GetMethodID(jclass, methodName, signature) : AndroidJNISafe.GetStaticMethodID(jclass, methodName, signature);
                if (!(intPtr2 != IntPtr.Zero))
                {
                    throw ex;
                }
                result = intPtr2;
            }
            finally
            {
                AndroidJNISafe.DeleteLocalRef(intPtr);
            }
            return(result);
        }
Ejemplo n.º 5
0
 private static IntPtr GetMethodIDFallback(IntPtr jclass, string methodName, string signature, bool isStatic)
 {
     try
     {
         return((!isStatic) ? AndroidJNISafe.GetMethodID(jclass, methodName, signature) : AndroidJNISafe.GetStaticMethodID(jclass, methodName, signature));
     }
     catch (Exception)
     {
     }
     return(IntPtr.Zero);
 }
Ejemplo n.º 6
0
        private static IntPtr GetMethodID(string clazz, string methodName, string signature)
        {
            IntPtr intPtr = AndroidJNISafe.FindClass(clazz);
            IntPtr methodID;

            try
            {
                methodID = AndroidJNISafe.GetMethodID(intPtr, methodName, signature);
            }
            finally
            {
                AndroidJNISafe.DeleteLocalRef(intPtr);
            }
            return(methodID);
        }
Ejemplo n.º 7
0
        public static IntPtr GetConstructorID(IntPtr jclass, string signature)
        {
            IntPtr num = IntPtr.Zero;

            try
            {
                num = AndroidReflection.GetConstructorMember(jclass, signature);
                return(AndroidJNISafe.FromReflectedMethod(num));
            }
            catch (Exception ex)
            {
                IntPtr methodId = AndroidJNISafe.GetMethodID(jclass, "<init>", signature);
                if (methodId != IntPtr.Zero)
                {
                    return(methodId);
                }
                throw ex;
            }
            finally
            {
                AndroidJNISafe.DeleteLocalRef(num);
            }
        }