DeviceConnectionDownEvent and how it is expected to be used by device providers
When a device provider should raise the DeviceConnectionDownEvent is a topic of some confusion. The Contoso device provider sample gave a wrong example of its use till recently. The sample has the following code inside the PhysicalDeviceProxy.Close method: DeviceConnectionDownEvent mgmtEvent = new DeviceConnectionDownEvent(“Closing connection for device ” + this.DeviceInformation.DeviceId); Notification notification = new Notification((DeviceManagementEvent)mgmtEvent); this.raiseNotificationEvent(new NotificationEventArgs(notification)); While there is nothing wrong with this code in itself, the place where it is being executed is wrong.
See the rest here:
DeviceConnectionDownEvent and how it is expected to be used by device providers


