Click or drag to resize

WinUsbManagerDeviceChange Event

Occurs when a matching USB device is attached or detached.

Namespace:  WinUsbNet
Assembly:  WinUsbNet (in WinUsbNet.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public event EventHandler<DeviceChangeEventArgs> DeviceChange

Value

Type: SystemEventHandlerDeviceChangeEventArgs
Examples
This example demonstrates using the IsAttach property of DeviceChangeEventArgs to determine if the event is fired for attach or detach.
void DeviceChange(object sender, DeviceChangeEventArgs e)
{
    if (e.IsAttach)
        GetSerialNumber(e.UsbDevice);
    else
        lstDevices.Items.Remove(e.UsbDevice);
}
See Also