ClaimedCashDrawer ClaimedCashDrawer ClaimedCashDrawer ClaimedCashDrawer Class

Definition

Provides access to exclusive and privileged methods, properties, and events on a point-of-service cash drawer device.

public : sealed class ClaimedCashDrawer : IClaimedCashDrawer, IClosablepublic sealed class ClaimedCashDrawer : IClaimedCashDrawer, IDisposablePublic NotInheritable Class ClaimedCashDrawer Implements IClaimedCashDrawer, IDisposable// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The user gets an instance of ClaimedCashDrawer from the CashDrawer.ClaimDrawerAsync method. Claim is cooperatively managed, so multiple concurrent apps can negotiate which app owns claim.

Properties

CloseAlarm CloseAlarm CloseAlarm CloseAlarm

Gets the close alarm for this cash drawer. This is only valid if IsDrawerOpenSensorAvailable is true.

public : CashDrawerCloseAlarm CloseAlarm { get; }public CashDrawerCloseAlarm CloseAlarm { get; }Public ReadOnly Property CloseAlarm As CashDrawerCloseAlarm// You can use this property in JavaScript.

DeviceId DeviceId DeviceId DeviceId

The identifier string of the claimed cash drawer device.

public : PlatForm::String DeviceId { get; }public string DeviceId { get; }Public ReadOnly Property DeviceId As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

String representing the ID of the device.

IsDrawerOpen IsDrawerOpen IsDrawerOpen IsDrawerOpen

Indicates whether the cash drawer is open.

public : PlatForm::Boolean IsDrawerOpen { get; }public bool IsDrawerOpen { get; }Public ReadOnly Property IsDrawerOpen As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

True if the drawer is open, otherwise false.

IsEnabled IsEnabled IsEnabled IsEnabled

Indicates whether the cash drawer is operational and can be used.

public : PlatForm::Boolean IsEnabled { get; }public bool IsEnabled { get; }Public ReadOnly Property IsEnabled As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

True if the cash drawer can be opened or CloseAlarm can be used; otherwise, false.

Methods

Close() Close() Close() Close()

Disposes the claimed cash drawer, releases claim on the device, and disables the device the same way as calling DisableAsync.

public : void Close()This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.

Remarks

Close methods aren't callable through Visual C++ component extensions (C++/CX) on Windows Runtime class instances where the class implemented IClosable. Instead, Visual C++ component extensions (C++/CX) code for runtime classes should call the destructor or set the last reference to null.

DisableAsync() DisableAsync() DisableAsync() DisableAsync()

Notifies the underlying hardware to power off.

public : IAsyncOperation<PlatForm::Boolean> DisableAsync()public IAsyncOperation<bool> DisableAsync()Public Function DisableAsync() As IAsyncOperation( Of bool )// You can use this method in JavaScript.
Returns

Whether the attempt to disable succeeded or not.

Remarks

This behaves identically to the existing POS peripheral API with the exception that this API returns an instance of IAsyncOperation<boolean> instead of IAsyncAction, so the caller does not need to catch exceptions to determine whether the attempt to disable succeeded or not.

Dispose() Dispose() Dispose() Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

This member is not implemented in C++void Dispose()Sub Disposevoid Dispose()

EnableAsync() EnableAsync() EnableAsync() EnableAsync()

Asynchronously notifies the underlying hardware to power on for use.

public : IAsyncOperation<PlatForm::Boolean> EnableAsync()public IAsyncOperation<bool> EnableAsync()Public Function EnableAsync() As IAsyncOperation( Of bool )// You can use this method in JavaScript.
Returns

Whether the attempt to enable succeeded or not.

Remarks

This behaves identically to the existing POS peripheral API with the exception that this API returns an instance of IAsyncOperation<boolean> instead of IAsyncAction, so the caller does not need to catch exceptions to determine whether the attempt to enable succeeded or not.

OpenDrawerAsync() OpenDrawerAsync() OpenDrawerAsync() OpenDrawerAsync()

Opens the cash drawer.

public : IAsyncOperation<PlatForm::Boolean> OpenDrawerAsync()public IAsyncOperation<bool> OpenDrawerAsync()Public Function OpenDrawerAsync() As IAsyncOperation( Of bool )// You can use this method in JavaScript.
Returns

Boolean indicating whether the drawer was successfully opened.

Remarks

All devices support this asynchronous operation.

ResetStatisticsAsync(IIterable) ResetStatisticsAsync(IIterable) ResetStatisticsAsync(IIterable) ResetStatisticsAsync(IIterable)

Resets the specified device statistics to their defaults.

public : IAsyncOperation<PlatForm::Boolean> ResetStatisticsAsync(IIterable<PlatForm::String> statisticsCategories)public IAsyncOperation<bool> ResetStatisticsAsync(IEnumerable<String> statisticsCategories)Public Function ResetStatisticsAsync(statisticsCategories As IEnumerable<String>) As IAsyncOperation( Of bool )// You can use this method in JavaScript.
Parameters
statisticsCategories
IIterable<PlatForm::String> IEnumerable<String> IEnumerable<String> IEnumerable<String>

The list of names of the statistics to reset.

  • An empty string ("") retrieves all statistics.
  • "U_" retrieves all UnifiedPOS defined statistics.
  • "M_" retrieves all manufacturer defined statistics.
  • "name1" and/or "name2" retrieves specific named statistics as defined by the UnifiedPOS or manufacturer.
  • Any combination of individual and groups names ("name3", "U_", "M_").
Returns

True on success; otherwise false.

Remarks

This method represents a change in state.

RetainDeviceAsync() RetainDeviceAsync() RetainDeviceAsync() RetainDeviceAsync()

Retain the current claim on the cash drawer. This is usually called in response to a ReleaseDeviceRequested event notification.

public : IAsyncOperation<PlatForm::Boolean> RetainDeviceAsync()public IAsyncOperation<bool> RetainDeviceAsync()Public Function RetainDeviceAsync() As IAsyncOperation( Of bool )// You can use this method in JavaScript.
Returns

True if the retain attempt succeeded; false if the retain attempt failed.

UpdateStatisticsAsync(IIterable<>>) UpdateStatisticsAsync(IIterable<>>) UpdateStatisticsAsync(IIterable<>>) UpdateStatisticsAsync(IIterable<>>)

Updates device statistics values using the provided key/value pair.

public : IAsyncOperation<PlatForm::Boolean> UpdateStatisticsAsync(IIterable<IKeyValuePair<PlatForm::String, PlatForm::String>> statistics)public IAsyncOperation<bool> UpdateStatisticsAsync(IEnumerable<KeyValuePair<String, String>> statistics)Public Function UpdateStatisticsAsync(statistics As IEnumerable<KeyValuePair<String, String>>) As IAsyncOperation( Of bool )// You can use this method in JavaScript.
Parameters
statistics
IIterable<IKeyValuePair<PlatForm::String, PlatForm::String>> IEnumerable<KeyValuePair<String, String>> IEnumerable<KeyValuePair<String, String>> IEnumerable<KeyValuePair<String, String>>

The statistics to update.

Returns

True if update succeeded; otherwise false.

Remarks

This method generates a change of state.

Events

ReleaseDeviceRequested ReleaseDeviceRequested ReleaseDeviceRequested ReleaseDeviceRequested

Occurs when the device gets a request to release its exclusive claim.

There is a small window of time (2 seconds) where the app may call RetainDeviceAsync to keep exclusive claim. Or alternatively, the app may release claim via Close to end the window immediately.

public : event TypedEventHandler ReleaseDeviceRequested<ClaimedCashDrawer,  object>public event TypedEventHandler ReleaseDeviceRequested<ClaimedCashDrawer,  object>Public Event ReleaseDeviceRequested<ClaimedCashDrawer,  object>// You can use this event in JavaScript.