void monitor_DeviceNotification(object sender, DeviceNotificationArgs e) { string message = string.Format("{4}.Device '{0}' has been {1} ({2}/{3}.", e.DeviceName, e.DeviceAttached ? "inserted" : "removed", e.DeviceClass, e.DeviceInterfaceGUID.ToString(), iCnt.ToString("000") ); //MessageBox.Show(message, "Disk Status"); addLog( message); iCnt++; }
void monitor_DeviceNotification(object sender, DeviceNotificationArgs e) { string message = string.Format("{4}.Device '{0}' has been {1} ({2}/{3}.", e.DeviceName, e.DeviceAttached ? "inserted" : "removed", e.DeviceClass, e.DeviceInterfaceGUID.ToString(), iCnt.ToString("000")); //MessageBox.Show(message, "Disk Status"); addLog(message); iCnt++; }
void OnDeviceNotification(object sender, DeviceNotificationArgs e) { if (eventList.InvokeRequired) { eventList.Invoke(new DeviceNotificationEventHandler(OnDeviceNotification), new object[] { sender, e }); return; } eventList.Items.Insert(0, string.Format("Class '{0}' Name '{1}' {2}", e.DeviceClass.ToString(), e.DeviceName, e.DeviceAttached ? "attached" : "detached")); }