Exemplo n.º 1
0
 void Init()
 {
     mDriveInfoList = UsbPrivate.BuildUsbDiskList();
     foreach (UsbDriveInfo driveInfo in mDriveInfoList)
     {
         mDriveDetector.HookQueryRemove(driveInfo.DriveId.DriveLetter);
     }
 }
Exemplo n.º 2
0
 void WinThread_mDriveDetector_DeviceInserted(object driveLetterObject)
 {
     try
     {
         char         driveLetter = ( char )driveLetterObject;
         UsbDriveInfo driveInfo   = UsbPrivate.LoadUsbFromDriveLetter(driveLetter);
         if (DeviceInserted != null && driveInfo != null)
         {
             DeviceInserted(this, driveInfo);
         }
     }
     catch (System.Exception e)
     {
         __LogError(this, "DeviceInserted failed", e);
     }
 }