PosExplorer.GetDevice Method (String)
2/27/2008
Retrieves a device of the specified type.
Namespace: Microsoft.PointOfService
Assembly: Microsoft.PointOfService (in microsoft.pointofservice.dll)
Syntax
'Declaration
Public Function GetDevice ( _
type As String _
) As DeviceInfo
public DeviceInfo GetDevice (
string type
)
public:
DeviceInfo^ GetDevice (
String^ type
)
public DeviceInfo GetDevice (
String type
)
public function GetDevice (
type : String
) : DeviceInfo
Parameters
- type
A string that contains one of the 36 POS device types, as defined by the DeviceType helper class.
Remarks
There must be only one device of that type currently in the system, or if there is more than one, one must have been configured as the default device. If there is more than one device of the specified type and no device has been configured as the default device, an exception will be thrown.
This signature of GetDevice represents the simplest case for retrieving and instantiating a device in the POS for .NET system. To retrieve one device and create an instance of its service object class, the application must only perform the following actions:
Create an instance of the PosExplorer class.
Call the GetDevice method by using the previous method signature.
Call the CreateInstance method, passing in the DeviceInfo returned from the GetDevice method call.
POS for .NET initializes the device of the type specified or, if there is more than one device of that type, the preconfigured default device for that type.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread-safe. Any instance members are not guaranteed to be thread-safe.
See Also
Reference
PosExplorer Class
PosExplorer Members
Microsoft.PointOfService Namespace
GetDevices