GetStaticFieldID() public static method

public static GetStaticFieldID ( IntPtr clazz, string name, string sig ) : IntPtr
clazz System.IntPtr
name string
sig string
return System.IntPtr
Example #1
0
        public static IntPtr GetFieldID(IntPtr jclass, string fieldName, string signature, bool isStatic)
        {
            IntPtr ptr3;
            IntPtr zero = IntPtr.Zero;

            try
            {
                zero = AndroidReflection.GetFieldMember(jclass, fieldName, signature, isStatic);
                ptr3 = AndroidJNISafe.FromReflectedField(zero);
            }
            catch (Exception exception)
            {
                IntPtr ptr2 = !isStatic?AndroidJNISafe.GetFieldID(jclass, fieldName, signature) : AndroidJNISafe.GetStaticFieldID(jclass, fieldName, signature);

                if (ptr2 == IntPtr.Zero)
                {
                    throw exception;
                }
                return(ptr2);
            }
            finally
            {
                AndroidJNISafe.DeleteLocalRef(zero);
            }
            return(ptr3);
        }
Example #2
0
        public static IntPtr GetFieldID(IntPtr jclass, string fieldName, string signature, bool isStatic)
        {
            IntPtr intPtr = IntPtr.Zero;

            try
            {
                intPtr = AndroidReflection.GetFieldMember(jclass, fieldName, signature, isStatic);
                return(AndroidJNISafe.FromReflectedField(intPtr));
            }
            catch (Exception ex)
            {
                IntPtr intPtr2 = (!isStatic) ? AndroidJNISafe.GetFieldID(jclass, fieldName, signature) : AndroidJNISafe.GetStaticFieldID(jclass, fieldName, signature);
                if (!(intPtr2 != IntPtr.Zero))
                {
                    throw ex;
                }
                return(intPtr2);
            }
            finally
            {
                AndroidJNISafe.DeleteLocalRef(intPtr);
            }
        }
        public static IntPtr GetFieldID(IntPtr jclass, string fieldName, string signature, bool isStatic)
        {
            IntPtr num1 = IntPtr.Zero;

            try
            {
                num1 = AndroidReflection.GetFieldMember(jclass, fieldName, signature, isStatic);
                return(AndroidJNISafe.FromReflectedField(num1));
            }
            catch (Exception ex)
            {
                IntPtr num2 = !isStatic?AndroidJNISafe.GetFieldID(jclass, fieldName, signature) : AndroidJNISafe.GetStaticFieldID(jclass, fieldName, signature);

                if (num2 != IntPtr.Zero)
                {
                    return(num2);
                }
                throw ex;
            }
            finally
            {
                AndroidJNISafe.DeleteLocalRef(num1);
            }
        }