private async void ButtonOk_Click(object sender, EventArgs e) { try { await WaitDialog.Execute(this, () => _slot.InitToken(null, TextBoxTokenLabel.Text)); DialogResult = DialogResult.OK; } catch (Exception ex) { WinFormsUtils.ShowError(this, ex); } }
private async void ButtonOk_Click(object sender, EventArgs e) { if (TextBoxPin.Text != TextBoxConfirmPin.Text) { WinFormsUtils.ShowInfo(this, "New PIN entries do not match"); return; } try { await WaitDialog.Execute(this, () => _slot.InitToken(TextBoxPin.Text, TextBoxTokenLabel.Text)); DialogResult = DialogResult.OK; } catch (Exception ex) { WinFormsUtils.ShowError(this, ex); } }