// Drop the selected user async Task DropUser() { try { var user = SelectedUser; if (user == null) { return; } // Confirm drop if (MessageBox.Show(string.Format("Drop user: {0}?", user.Name), "Confirm User Drop", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.Cancel) { return; } var response = await InfluxDbClient.DropUserAsync(user.Name); // Select the user and refresh the window if (response.Success) { SelectedUser = null; await ExecuteRequestAsync(); } else { AppForm.DisplayError(response.Body); } // Update interface buttons UpdateUIState(); } catch (Exception ex) { AppForm.DisplayException(ex); } }