コード例 #1
0
        public static IntPtr ToLocalJniHandle(ICollection items)
        {
            if (items == null)
            {
                return(IntPtr.Zero);
            }

            var s = items as JavaSet;

            if (s != null)
            {
                return(JNIEnv.ToLocalJniHandle(s));
            }

            using (s = new JavaSet(items))
                return(JNIEnv.ToLocalJniHandle(s));
        }
コード例 #2
0
        public static ICollection FromJniHandle(IntPtr handle, JniHandleOwnership transfer)
        {
            if (handle == IntPtr.Zero)
            {
                return(null);
            }

            IJavaObject inst = (IJavaObject)Java.Lang.Object.PeekObject(handle);

            if (inst == null)
            {
                inst = new JavaSet(handle, transfer);
            }
            else
            {
                JNIEnv.DeleteRef(handle, transfer);
            }

            return((ICollection)inst);
        }
コード例 #3
0
ファイル: JavaSet.cs プロジェクト: yudhitech/xamarin-android
        public static IntPtr ToLocalJniHandle(ICollection items)
        {
            if (items == null)
                return IntPtr.Zero;

            var s = items as JavaSet;
            if (s != null)
                return JNIEnv.ToLocalJniHandle (s);

            using (s = new JavaSet (items))
                return JNIEnv.ToLocalJniHandle (s);
        }
コード例 #4
0
ファイル: JavaSet.cs プロジェクト: yudhitech/xamarin-android
        public static ICollection FromJniHandle(IntPtr handle, JniHandleOwnership transfer)
        {
            if (handle == IntPtr.Zero)
                return null;

            IJavaObject inst = Java.Lang.Object.PeekObject (handle);
            if (inst == null)
                inst = new JavaSet (handle, transfer);
            else
                JNIEnv.DeleteRef (handle, transfer);

            return (ICollection) inst;
        }