示例#1
0
        public void SendCommandsAction(Communication.Result result)
        {
            Device.BeginInvokeOnMainThread(() =>
            {
                DisplayAlert(result.ToString(), null, "OK");
            });

            this.contentPageComponent.UserInteractionEnabled = true;
        }
示例#2
0
        public void GetDeviceStatusAction(Communication.Result result, IPrinterStatus printerStatus)
        {
            if (result == Communication.Result.Success)
            {
                this.listViewItemCollection.Add(new ListViewItem("Online", printerStatus.Offline,   new string[] {"Offline", "Online"}, new Color[] {Color.Red, Color.Blue}));
                this.listViewItemCollection.Add(new ListViewItem("Cover",  printerStatus.CoverOpen, new string[] {"Open",    "Closed"}, new Color[] {Color.Red, Color.Blue}));

                if (printerStatus.ReceiptPaperEmpty)
                {
                    this.listViewItemCollection.Add(new ListViewItem("Paper", "Empty",      Color.Red));
                }
                else if (printerStatus.ReceiptPaperNearEmptyInner ||
                         printerStatus.ReceiptPaperNearEmptyOuter)
                {
                    this.listViewItemCollection.Add(new ListViewItem("Paper", "Near Empty", Color.Orange));
                }
                else
                {
                    this.listViewItemCollection.Add(new ListViewItem("Paper", "Ready",      Color.Blue));
                }

                if (Configuration.CashDrawerOpenActiveHigh)
                {
                    this.listViewItemCollection.Add(new ListViewItem("Cash Drawer",   printerStatus.CompulsionSwitch, new string[] {"Open", "Closed"}, new Color[] {Color.Red, Color.Blue}));
                }
                else
                {
                    this.listViewItemCollection.Add(new ListViewItem("Cash Drawer", ! printerStatus.CompulsionSwitch, new string[] {"Open", "Closed"}, new Color[] {Color.Red, Color.Blue}));
                }

                this.listViewItemCollection.Add(new ListViewItem("Head Temperature",      printerStatus.OverTemp,            new string[] {"High",   "Normal"}, new Color[] {Color.Red, Color.Blue}));
                this.listViewItemCollection.Add(new ListViewItem("Non Recoverable Error", printerStatus.UnrecoverableError,  new string[] {"Occurs", "Ready"},  new Color[] {Color.Red, Color.Blue}));
                this.listViewItemCollection.Add(new ListViewItem("Paper Cutter",          printerStatus.CutterError,         new string[] {"Error",  "Ready"},  new Color[] {Color.Red, Color.Blue}));
                this.listViewItemCollection.Add(new ListViewItem("Head Thermistor",       printerStatus.HeadThermistorError, new string[] {"Error",  "Normal"}, new Color[] {Color.Red, Color.Blue}));
                this.listViewItemCollection.Add(new ListViewItem("Voltage",               printerStatus.VoltageError,        new string[] {"Error",  "Normal"}, new Color[] {Color.Red, Color.Blue}));
            }
            else
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    DisplayAlert(result.ToString(), null, "OK");
                });
            }

            this.contentPageComponent.UserInteractionEnabled = true;
        }