private void showForm() { using (var cfgForm = new API_Form()) { var result = cfgForm.ShowDialog(); if (result != DialogResult.OK) { return; } apiKey = Properties.Settings.Default.ApiKey; } }
private string getAPIKey() { if (string.IsNullOrWhiteSpace(apiKey)) { using (var cfgForm = new API_Form()) { var result = cfgForm.ShowDialog(); if (result != DialogResult.OK) { return(null); } apiKey = Properties.Settings.Default.ApiKey; } } return(apiKey); }