IsNull() 공개 정적인 메소드

public static IsNull ( JniHandle handle ) : bool
handle JniHandle
리턴 bool
예제 #1
0
 public static String StrongJ2CpString(JNIEnv env, JniLocalHandle obj)
 {
     if (JniHandle.IsNull(obj))
     {
         return(null);
     }
     return(String.CreateProxy(env, obj));
 }
예제 #2
0
 public static Class StrongJ2CpClass(JNIEnv env, JniLocalHandle obj)
 {
     if (JniHandle.IsNull(obj))
     {
         return(null);
     }
     return(Class.CreateProxy(env, obj));
 }
예제 #3
0
        public static string StrongJp2CString(JNIEnv env, JniLocalHandle obj)
        {
            if (JniHandle.IsNull(obj))
            {
                return(null);
            }
            object res = __IClrProxy.GetObject(env, obj);

            return((string)res);
        }
예제 #4
0
        public static string StrongJ2CString(JNIEnv env, JniLocalHandle obj)
        {
            if (JniHandle.IsNull(obj))
            {
                return(null);
            }
            string res = env.ConvertToString(obj);

            return(res);
        }
예제 #5
0
        public static TRes StrongJp2C <TRes>(JNIEnv env, JniLocalHandle obj)
        {
            if (JniHandle.IsNull(obj))
            {
                return(default(TRes));
            }
            object res = __IClrProxy.GetObject(env, obj);

            return((TRes)res);
        }
예제 #6
0
        public static TRes StrongJ2Cp <TRes>(JNIEnv env, JniLocalHandle obj)
            where TRes : IJvmProxy
        {
            if (JniHandle.IsNull(obj))
            {
                return(default(TRes));
            }
            Class          clazz  = env.GetObjectClass(obj);
            RegistryRecord record = Registry.GetJVMRecord(clazz);

            return((TRes)record.CreateCLRProxy(env, obj));
        }
예제 #7
0
        public static object StrongJ2CpUntyped(IntPtr ptr)
        {
            JNIEnv         env = JNIEnv.ThreadEnv;
            JniLocalHandle obj = ptr;

            if (JniHandle.IsNull(obj))
            {
                return(null);
            }
            Class          clazz  = env.GetObjectClass(obj);
            RegistryRecord record = Registry.GetJVMRecord(clazz);

            return(record.CreateCLRProxyNoDelete(env, obj));
        }
예제 #8
0
        public static TRes ArrayStrongJp2C <TRes, TElem>(JNIEnv env, JniLocalHandle array)
            where TRes : class //should be TRes : Array
        {
            if (JniHandle.IsNull(array))
            {
                return(default(TRes));
            }
            int length = env.GetArrayLength(array);
            var res    = new TElem[length];

            for (int i = 0; i < length; i++)
            {
                JniLocalHandle elementPtr = env.GetObjectArrayElementPtr(array, i);
                var            element    = StrongJp2C <TElem>(env, elementPtr);
                res.SetValue(element, i);
            }
            return((TRes)(object)res);
        }
예제 #9
0
        public static TRes StrongJ2CpDelegate <TRes>(JNIEnv env, JniLocalHandle obj)
            where TRes : class //Delegate
        {
#if DEBUG
            if (!typeof(Delegate).IsAssignableFrom(typeof(TRes)))
            {
                throw new ArgumentException("expected delegate");
            }
#endif
            if (JniHandle.IsNull(obj))
            {
                return(default(TRes));
            }
            object res = __IClrProxy.GetObject(env, obj);
            if (res == null)
            {
                //that's delegate implemented in Java
                RegistryRecord delRecord = Registry.GetCLRRecord(typeof(TRes));
                IJvmProxy      jvmProxy  = delRecord.CreateCLRProxy(env, obj);
                return((TRes)(object)Delegate.CreateDelegate(typeof(TRes), jvmProxy, delRecord.JVMDelegateInvoke));
            }
            return((TRes)res);
        }