public SettingsView(ICardInterfaceManger contactCardInterfaceManger, ICardInterfaceManger contactlessCardInterfaceManger) { InitializeComponent(); this.contactCardInterfaceManger = contactCardInterfaceManger; this.contactlessCardInterfaceManger = contactlessCardInterfaceManger; gridProgress.IsVisible = true; try { Task.Run(async() => { ObservableCollection <string> contactIds = new ObservableCollection <string>(); ObservableCollection <string> contactlessIds = new ObservableCollection <string>(); if (contactCardInterfaceManger != null) { contactIds = await contactCardInterfaceManger.GetCardReaders(); } if (contactlessCardInterfaceManger != null) { contactlessIds = await contactlessCardInterfaceManger.GetCardReaders(); } UpdateView(contactIds, contactlessIds); }); } catch (Exception ex) { Task.Run(async() => { await App.Current.MainPage.DisplayAlert("Error", ex.Message, "OK"); }); } finally { gridProgress.IsVisible = false; } }
public SettingsView(ICardInterfaceManger cardInterfaceManger) { InitializeComponent(); this.cardInterfaceManger = cardInterfaceManger; gridProgress.IsVisible = true; try { Task.Run(async() => { ObservableCollection <string> ids = await cardInterfaceManger.GetCardReaders(); UpdateView(ids); }); } catch (Exception ex) { Task.Run(async() => { await App.Current.MainPage.DisplayAlert("Error", ex.Message, "OK"); }); } finally { gridProgress.IsVisible = false; } }
private async void CmdProcess_Click(object sender, EventArgs e) { try { List <string> ids = (await cardInterfaceManger.GetCardReaders()).Where(x => x.ToLower().Contains("contactless")).ToList(); if (ids.Count == 0) { await App.Current.MainPage.DisplayAlert("Error", "No contactless reader found", "OK"); return; } ta = new DesfireTerminalApplicationBase(new CardQProcessor(cardInterfaceManger, ids[0])); ta.UserInterfaceRequest += Ta_UserInterfaceRequest; ta.ProcessCompleted += Ta_ProcessCompleted; ta.ExceptionOccured += Ta_ExceptionOccured; ta.StartTransactionRequest(DesFireTransactionTypeEnum.ProcessTransaction); } catch (Exception ex) { SetStatusLabel(ex.Message); } }
private async void CmdProcess_Click(object sender, EventArgs e) { try { SetProcessButtonEnabled(false); TransactionRequest tr = new TransactionRequest(transactionVM.Amount + transactionVM.AmountOther, transactionVM.AmountOther, (TransactionTypeEnum)cmbTransactionType.SelectedItem); List <string> ids = (await cardInterfaceManger.GetCardReaders()).Where(x => x.ToLower().Contains("contactless")).ToList(); if (ids.Count == 0) { await App.Current.MainPage.DisplayAlert("Error", "No contactless reader found", "OK"); return; } ta = new EMVTerminalApplication(new CardQProcessor(cardInterfaceManger, ids[0]), configProvider); ta.UserInterfaceRequest += Ta_UserInterfaceRequest; ta.ProcessCompleted += Ta_ProcessCompleted; ta.ExceptionOccured += Ta_ExceptionOccured; ta.StartTransactionRequest(tr); } catch (Exception ex) { SetStatusLabel(ex.Message); } }