public MainForm() { InitializeComponent(); startButton.Enabled = false; removeButton.Enabled = false; _credentialsManager = new CredentialsManager(); _credentialsManager.MappedTypes.Add(typeof(CrystalCredentials).Name, typeof(CrystalCredentials)); _credentialsManager.MappedTypes.Add(typeof(ZirconCredentials).Name, typeof(ZirconCredentials)); _credentialsManager.Load(); RefreshUi(); }
/// <inheritdoc/> public Task <ISonarQubeClient> LogInFromRepositoryAsync(IRepository <UriRepositoryItem> repository, ICredentialsManager credentialsManager) { var targetUri = repository.Data.TargetUri; if (targetUri is null) { return(Task.FromResult <ISonarQubeClient>(null)); } var credential = credentialsManager.Load(targetUri); if (credential is null) { return(Task.FromResult <ISonarQubeClient>(null)); } return(LogInAsync(targetUri, credential.Username, credential.Password)); }