LibUsbDotNet 2.2.8
IDeviceNotifier Interface
Library Reference ► LibUsbDotNet.DeviceNotify ► IDeviceNotifier
|
![]() |
Notifies an application of a change to the hardware Configuration of a device or
the computer.

C# | Visual Basic | Visual C++ |
public interface IDeviceNotifier
Public Interface IDeviceNotifier
public interface class IDeviceNotifier

All Members | Properties | Events | |||
|
|
|
Icon | Member | Description |
---|---|---|
![]() |
Enabled |
Enables/Disables notification events.
|
![]() |
OnDeviceNotify |
Main Notify event for all device notifications.
|

For devices that offer software-controllable features, such as ejection and locking,
the system typically sends a DeviceRemovePending message to
let applications and device drivers end their use of the device gracefully. If the
system forcibly removes a device, it may not send a
DeviceQueryRemove message before doing so.


using System; using System.Windows.Forms; using LibUsbDotNet.DeviceNotify; namespace Test_DeviceNotify { public partial class fTestDeviceNotify : Form { private IDeviceNotifier devNotifier; delegate void AppendNotifyDelegate(string s); public fTestDeviceNotify() { InitializeComponent(); devNotifier = DeviceNotifier.OpenDeviceNotifier(); devNotifier.OnDeviceNotify += onDevNotify; } private void onDevNotify(object sender, DeviceNotifyEventArgs e) { Invoke(new AppendNotifyDelegate(AppendNotifyText),new object[] {e.ToString()}); } private void AppendNotifyText(string s) { tNotify.AppendText(s); } private void tNotify_DoubleClick(object sender, EventArgs e) { tNotify.Clear(); } } }