예제 #1
0
 internal MtpDevice(MtpDeviceHandle handle, MtpDeviceStruct device)
 {
     this.device = device;
     this.Handle = handle;
     this.name   = GetFriendlyName(Handle);
     SetDefaultFolders();
 }
예제 #2
0
        public static List <MtpDevice> Detect()
        {
            IntPtr ptr;

            GetConnectedDevices(out ptr);

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

            while (ptr != IntPtr.Zero)
            {
                MtpDeviceStruct d = (MtpDeviceStruct)Marshal.PtrToStructure(ptr, typeof(MtpDeviceStruct));
                devices.Add(new MtpDevice(ptr, true, d));
                ptr = d.next;
            }

            return(devices);
        }
예제 #3
0
 internal MtpDevice(IntPtr handle, bool ownsHandle, MtpDeviceStruct device)
     : this(new MtpDeviceHandle(handle, ownsHandle), device)
 {
 }
예제 #4
0
 internal MtpDevice(IntPtr handle, bool ownsHandle, MtpDeviceStruct device)
     : this(new MtpDeviceHandle(handle, ownsHandle), device)
 {
     
 }
예제 #5
0
 internal MtpDevice (MtpDeviceHandle handle, MtpDeviceStruct device)
 {
     this.device = device;
     this.Handle = handle;
     this.name = GetFriendlyName(Handle);
     this.ModelName = GetModelName (Handle);
     SetDefaultFolders ();
 }