LibUsbDotNet 2.2.8
AddRemoveEvent Event
Library Reference ► MonoLibUsb.Profile ► MonoUsbProfileList ► AddRemoveEvent
|
Usb device arrival/removal notification handler.
This event only reports when the Refresh(MonoUsbSessionHandle) method is called.
Declaration Syntax
C# | Visual Basic | Visual C++ |
public event EventHandler<AddRemoveEventArgs> AddRemoveEvent
Public Event AddRemoveEvent As EventHandler(Of AddRemoveEventArgs)
public: event EventHandler<AddRemoveEventArgs^>^ AddRemoveEvent { void add (EventHandler<AddRemoveEventArgs^>^ value); void remove (EventHandler<AddRemoveEventArgs^>^ value); }
Remarks
AddRemoveEvent could be used for a crude form for receiving usb
device arrival/removal notification.
Examples
CopyC#
// Startup code MonoUsbProfileList profileList = new MonoUsbProfileList(); profileList.AddRemoveEvent += OnDeviceAddRemove; // Device AddRemove event template private void OnDeviceAddRemove(object sender, AddRemoveEventArgs addRemoveArgs) { // This method will only report when Refresh() is called. } // Refresh profile list. // Any devices added or removed since the last call to Refresh() will be returned // in the OnDeviceAddRemove method. profileList.Refresh();