private async void OnConfigChanged(object sender, EventArgs e) { // this updates _textView.Text var config = _configCombo.SelectedValue as BuildType; if (config == null) { return; } await _model.LoadArtifacts(config.Id); var server = _serversCombo.SelectedValue as Server; var tcServer = server as TeamCityApi; if (tcServer != null) { var template = GetArtifact(); if (template == null) { return; } _artifacts = await tcServer.GetArtifactsAsync(template); } UpdatePreview(); }
private async void OnConfigChanged(object sender, EventArgs e) { using (new WaitSpinner(_spinner)) { var config = _configCombo.SelectedValue as BuildType; if (config == null) { return; } SelectedBuildConfig = config.Id; await Task.Run(async() => { _dataStore.Clear(); var artifactsTask = _model.LoadArtifacts(config.Id); var depTask = _model.TeamCity.GetArtifactDependenciesAsync(config.Id); await artifactsTask; var dependencies = await depTask; if (dependencies == null) { return; } foreach (var dep in dependencies) { if (dep == null || dep.Properties == null || dep.BuildType == null) { continue; } var artifact = new ArtifactTemplate(_model.TeamCity, new ArtifactProperties(dep.Properties), dep.BuildType); _dataStore.Add(artifact); } }); } }