I am using the code below, I was hoping to get the events but nothing happended. Any thing I am doing wrong?
public static void Main()
{
// Subscribe to RemovableMedia events
RemovableMedia.Insert += RemovableMedia_Insert;
RemovableMedia.Eject += RemovableMedia_Eject;
// Subscribe to USB events
USBHostController.DeviceConnectedEvent += DeviceConnectedEvent;
// Sleep forever
Thread.Sleep(Timeout.Infinite);
}
static void DeviceConnectedEvent(USBH_Device device)
{
if (device.TYPE == USBH_DeviceType.MassStorage)
{
Debug.Print("USB Mass Storage detected...");
//....
//....
}
}
static void RemovableMedia_Insert (
Object sender,
MediaEventArgs e)
{
Debug.Print("USB Mass Storage Inserted...");
}
static void RemovableMedia_Eject(
Object sender,
MediaEventArgs e)
{
Debug.Print("USB Mass Storage Ejected...");
}