Пример #1
0
        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();
        }
Пример #2
0
        /// <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));
        }