private void cmdOk_Click(object sender, RoutedEventArgs e) { if (SuplexSecurityDalClient.ValidateServiceConnection(txtWebApiUrl.Text, out string exception)) { WebApiUrl = txtWebApiUrl.Text; txtStatus.Text = $"Connected to {txtWebApiUrl.Text}!"; DialogResult = true; Close(); } else { txtStatus.Text = exception; } }
private void mnuRecentConnection_Click(object sender, RoutedEventArgs e) { if (GlobalVerifySaveChanges()) { string url = ((MenuItem)e.OriginalSource).Header.ToString(); if (SuplexSecurityDalClient.ValidateServiceConnection(url, out string exception)) { _dal.InitWebApiConnection(url); } else { MessageBox.Show(exception, "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation); } } }