Esempio n. 1
0
        public static List <RawMtpDevice> Detect()
        {
            int    count = 0;
            IntPtr ptr   = IntPtr.Zero;

            LIBMTP_Detect_Raw_Devices(ref ptr, ref count);

            List <RawMtpDevice> devices = new List <RawMtpDevice>();

            for (int i = 0; i < count; i++)
            {
                IntPtr          offset = Offset(ptr, i * Marshal.SizeOf(typeof(RawDeviceStruct)));
                RawDeviceStruct d      = (RawDeviceStruct)Marshal.PtrToStructure(offset, typeof(RawDeviceStruct));
                devices.Add(new RawMtpDevice(d));
            }

            return(devices);
        }
Esempio n. 2
0
 internal RawMtpDevice(RawDeviceStruct device)
 {
     RawDevice = device;
 }
Esempio n. 3
0
 private static extern IntPtr LIBMTP_Open_Raw_Device(ref RawDeviceStruct rawdevice);
Esempio n. 4
0
 internal RawMtpDevice (RawDeviceStruct device)
 {
     RawDevice = device;
 }
Esempio n. 5
0
 private static extern IntPtr LIBMTP_Open_Raw_Device (ref RawDeviceStruct rawdevice);