PosExplorer.DeviceRemovedEvent Event (POS for .NET v1.12 SDK Documentation)
2/27/2008
Notifies the application when a POS device has been removed from the system.
Namespace: Microsoft.PointOfService
Assembly: Microsoft.PointOfService (in microsoft.pointofservice.dll)
Syntax
'Declaration
Public Event DeviceRemovedEvent As DeviceChangedEventHandler
public event DeviceChangedEventHandler DeviceRemovedEvent
public:
event DeviceChangedEventHandler^ DeviceRemovedEvent {
void add (DeviceChangedEventHandler^ value);
void remove (DeviceChangedEventHandler^ value);
}
/** @event */
public void add_DeviceRemovedEvent (DeviceChangedEventHandler value)
/** @event */
public void remove_DeviceRemovedEvent (DeviceChangedEventHandler value)
Example
The following example demonstrates how an application might handle a DeviceRemovedEventevent:
posExplorer.DeviceRemovedEvent += new (DeviceChangedEventHandler(OnDeviceRemoved);
Msr msr = (Msr) posExplorer.CreateInstance(deviceInfo);
msr.Open();
...
private void OnDeviceRemoved(object source, DeviceChangedEventArgs e)
{
if (e.Device.IsDeviceInfoOf(msr))
msr.Close();
}
Remarks
DeviceRemovedEvent only notifies for POS devices for which there is a service object installed.
The event handler receives an argument of type DeviceChangedEventArgs which contains a DeviceInfo object for the removed device.
See Also
Reference
PosExplorer Class
PosExplorer Members
Microsoft.PointOfService Namespace
DeviceInfo Class
DeviceChangedEventArgs Class