示例#1
0
        public int BlackBerry_ImageAppData(int blackberryHadnle, string psavedir)
        {
            IntPtr linkApps = IntPtr.Zero;
            int    nums     = 0;

            try
            {
                int backResult = BlackBerryDeviceAPI.BlackBerry_GetAppDataInfo((IntPtr)blackberryHadnle, ref linkApps, ref nums);

                return(BlackBerryDeviceAPI.BlackBerry_ImageAppData((IntPtr)blackberryHadnle, psavedir, backResult, nums, BlackBerryImageDataCallBack));
            }
            finally
            {
                if (linkApps != IntPtr.Zero)
                {
                    BlackBerryDeviceAPI.BlackBerry_ReleaseBuffer(ref linkApps);
                }
            }
        }
示例#2
0
        public List <BlackPhoneInfo> BlackBerry_FindDevices()
        {
            List <BlackPhoneInfo> list = new List <BlackPhoneInfo>();

            IntPtr linkPhone = IntPtr.Zero;
            int    nums      = 0;
            int    result    = 0;

            try
            {
                KillProcess("Rim.Desktop");
                result = BlackBerryDeviceAPI.BlackBerry_DeviceFind(ref linkPhone, ref nums);

                if (result != 0 || linkPhone == IntPtr.Zero)
                {
                    return(list);
                }

                IntPtr pitem = linkPhone;

                for (int pos = 0; pos < nums; pos++)
                {
                    list.Add(Marshal.PtrToStructure <BlackPhoneInfo>(pitem));

                    pitem += Marshal.SizeOf(typeof(BlackPhoneInfo));
                }
            }
            catch
            {
            }
            finally
            {
                if (IntPtr.Zero != linkPhone)
                {
                    BlackBerryDeviceAPI.BlackBerry_ReleaseBuffer(ref linkPhone);
                }
            }

            return(list);
        }
示例#3
0
        public List <BlackPhoneAppContentInfo> BlackBerry_GetAppDataInfo(int blackberryHadnle)
        {
            List <BlackPhoneAppContentInfo> list = new List <BlackPhoneAppContentInfo>();

            IntPtr linkApps = IntPtr.Zero;
            int    nums     = 0;
            int    result   = 0;

            try
            {
                result = BlackBerryDeviceAPI.BlackBerry_GetAppDataInfo((IntPtr)blackberryHadnle, ref linkApps, ref nums);
                if (0 != result || IntPtr.Zero == linkApps || 0 == nums)
                {
                    return(list);
                }

                IntPtr pitem = linkApps;

                for (int pos = 0; pos < nums; pos++)
                {
                    list.Add(Marshal.PtrToStructure <BlackPhoneAppContentInfo>(pitem));

                    pitem += Marshal.SizeOf(typeof(BlackPhoneAppContentInfo));
                }
            }
            catch
            {
            }
            finally
            {
                if (linkApps != IntPtr.Zero)
                {
                    BlackBerryDeviceAPI.BlackBerry_ReleaseBuffer(ref linkApps);
                }
            }

            return(list);
        }
示例#4
0
        public void BlackBerry_ReleaseBuffer(int dataHandle)
        {
            IntPtr ip = (IntPtr)dataHandle;

            BlackBerryDeviceAPI.BlackBerry_ReleaseBuffer(ref ip);
        }