PosExplorer.DeviceAddedEvent Event (POS for .NET v1.12 SDK Documentation)
2/27/2008
Notifies the application when a POS device has been added to the system.
Namespace: Microsoft.PointOfService
Assembly: Microsoft.PointOfService (in microsoft.pointofservice.dll)
Syntax
'Declaration
Public Event DeviceAddedEvent As DeviceChangedEventHandler
public event DeviceChangedEventHandler DeviceAddedEvent
public:
event DeviceChangedEventHandler^ DeviceAddedEvent {
void add (DeviceChangedEventHandler^ value);
void remove (DeviceChangedEventHandler^ value);
}
/** @event */
public void add_DeviceAddedEvent (DeviceChangedEventHandler value)
/** @event */
public void remove_DeviceAddedEvent (DeviceChangedEventHandler value)
Example
The following example demonstrates how an application might handle a DeviceAddedEvent event:
posExplorer.DeviceAddedEvent += new (DeviceChangedEventHandler(OnDeviceAdded);
Msr msr;
private void OnDeviceAdded(object source, DeviceChangedEventArgs e)
{
if (e.Device.Type == DeviceType.Msr)
Msr = (Msr) posExplorer.CreateInstance(e.Device);
}
Remarks
DeviceAddedEvent 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 added device.
See Also
Reference
PosExplorer Class
PosExplorer Members
Microsoft.PointOfService Namespace
DeviceInfo Class
DeviceChangedEventArgs Class