internal MtpDevice(MtpDeviceHandle handle, MtpDeviceStruct device) { this.device = device; this.Handle = handle; this.name = GetFriendlyName(Handle); SetDefaultFolders(); }
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); }
internal MtpDevice(IntPtr handle, bool ownsHandle, MtpDeviceStruct device) : this(new MtpDeviceHandle(handle, ownsHandle), device) { }
internal MtpDevice (MtpDeviceHandle handle, MtpDeviceStruct device) { this.device = device; this.Handle = handle; this.name = GetFriendlyName(Handle); this.ModelName = GetModelName (Handle); SetDefaultFolders (); }