private void btnAddAccount_Click( object sender, RoutedEventArgs e ) { var frmAddAccount = new AddEditAccount(); var result = frmAddAccount.ShowDialog(); if (!result.HasValue || !result.Value) return; var newApiKey = frmAddAccount.GetApiKeyFromUI(); // Add api key to list AddApiKeyToList(newApiKey); }
private void btnEditAccount_Click( object sender, RoutedEventArgs e ) { var currentApiKey = GetSelectedApiKey(); if(currentApiKey == null) return; var frmEditAccount = new AddEditAccount(); frmEditAccount.SetApiKeyToUI((EveApiKey)currentApiKey); var result = frmEditAccount.ShowDialog(); if (!result.HasValue || !result.Value) return; var newApiKey = frmEditAccount.GetApiKeyFromUI(); // Add api key to list UpdateApiKeyInList(newApiKey); }