Пример #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);
        }
Пример #2
0
 internal RawMtpDevice(RawDeviceStruct device)
 {
     RawDevice = device;
 }
Пример #3
0
 private static extern IntPtr LIBMTP_Open_Raw_Device(ref RawDeviceStruct rawdevice);
Пример #4
0
 internal RawMtpDevice (RawDeviceStruct device)
 {
     RawDevice = device;
 }
Пример #5
0
 private static extern IntPtr LIBMTP_Open_Raw_Device (ref RawDeviceStruct rawdevice);