private void MBtnTestPrint_Click(object sender, EventArgs e) { using (var mBluetoothAdapter = BluetoothAdapter.DefaultAdapter) { if (mBluetoothAdapter == null) { DialogMessageService.MessageBox(this, "Attention", "This device does not support bluetooth"); } else if (mBluetoothAdapter.IsEnabled) { BluetoothDevice printer = mBluetoothAdapter.GetRemoteDevice(mSettingsDataAccess.SelectTable()[0].ReceiptPrinterAddress); PrintReceiptService printReceiptService = new PrintReceiptService(); printReceiptService.PrintText(printer, new List <string>() { "PRINTER WORKING" }); } else { DialogMessageService.MessageBox(this, "Attention", "Please turn on your Bluetooth to connect the printer to your phone."); } } }
static void Main(string[] args) { PrintingServices.FillList(); Console.WriteLine(PrintReceiptService.PrintBill()); }