BlinkStickDotNet.WinUsbDeviceMonitor.OnDeviceListChanged C# (CSharp) Method

OnDeviceListChanged() protected method

Raises the device list changed event.
protected OnDeviceListChanged ( ) : void
return void
		protected void OnDeviceListChanged()
		{
			if (DeviceListChanged != null)
			{
				DeviceListChanged(this, new EventArgs());
			}
		}

Usage Example

示例#1
0
            const int DBT_DEVTYP_VOLUME        = 0x00000002;  // logical volume

            //[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
            protected override void WndProc(ref Message m)
            {
                if (m.Msg == WM_DEVICECHANGE &&
                    (m.WParam.ToInt32() == DBT_DEVICEARRIVAL ||
                     m.WParam.ToInt32() == DBT_DEVICEREMOVECOMPLETE ||
                     m.WParam.ToInt32() == DBT_DEVNODES_CHANGED))
                {
                    if (this.Enabled)
                    {
                        Monitor.OnDeviceListChanged();
                    }
                }

                base.WndProc(ref m);
            }