简体   繁体   中英

How to fire cash drawer closing event using CashDrawer Class (POS for .NET v1.12)

I am developing an POS application, I am able to open the cash drawer.

but I am not able to find the event when cash drawer is closed.

Please provide me code sample/ event which fire when cash drawer get closed.

Listen to OnDrawerStateChanged event and inspect DrawerStateChangedEventArgs.DrawerOpened value. A false means closed. Per MSDN:

The CashDrawerBase class raises OnDrawerStateChanged events to inform the service object that the value of the CashDrawerProperties.DrawerOpened property has been updated and the application has been notified of a drawer status change. A DrawerStateChangedEventArgs.DrawerOpened value of true indicates the drawer status has changed to “open”; a DrawerStateChangedEventArgs.DrawerOpened value of false indicates the drawer status has changed to “closed”. Service objects should consider implementing OnDrawerStateChanged when they want to be notified by the CashDrawerBase class of drawer state changes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM