// Shows the create policy dialog async Task ShowCreatePolicy() { try { // Clear out the dialog values policyDialog.ResetPolicyValues(); if (policyDialog.ShowDialog() == DialogResult.OK) { var name = policyDialog.PolicyName; var duration = policyDialog.PolicyDuration; var replication = policyDialog.PolicyReplication; var isDefault = policyDialog.PolicyDefault; var response = await InfluxDbClient.CreateRetentionPolicyAsync(SelectedDatabase, name, duration, replication, isDefault); if (!response.Success) { AppForm.DisplayError(response.Body); } // Reload latest data await ExecuteRequestAsync(); } } catch (Exception ex) { AppForm.DisplayException(ex); } }