public ProjectDeploymentInfo(ProjectInfo projectInfo, ProjectConfiguration projectConfiguration, ProjectConfigurationBuild projectConfigurationBuild, string targetEnvironmentName)
        {
            if (projectInfo == null)
              {
            throw new ArgumentNullException("projectInfo");
              }

              if (projectConfiguration == null)
              {
            throw new ArgumentNullException("projectConfiguration");
              }

              if (projectConfigurationBuild == null)
              {
            throw new ArgumentNullException("projectConfigurationBuild");
              }

              if (string.IsNullOrEmpty(targetEnvironmentName))
              {
            throw new ArgumentException("Argument can't be null nor empty.", "targetEnvironmentName");
              }

              ProjectInfo = projectInfo;
              ProjectConfiguration = projectConfiguration;
              ProjectConfigurationBuild = projectConfigurationBuild;
              TargetEnvironmentName = targetEnvironmentName;
        }
Beispiel #2
0
        private void LoadProjectConfigurationBuilds(string projectName, ProjectConfiguration projectConfiguration)
        {
            GuiUtils.BeginInvoke(
            this,
            () =>
              {
            dgv_projectConfigurationBuilds.DataSource = null;

            txtFilterBuilds.Text = "";
              });

              ThreadPool.QueueUserWorkItem(
            state =>
              {
            try
            {
              int requestNumber;

              lock (_projectConfigurationBuildsRequestsMutex)
              {
                _projectConfigurationBuildsRequestsCounter++;
                requestNumber = _projectConfigurationBuildsRequestsCounter;
              }

              LogMessage(string.Format("Loading project configuration builds for project configuration: '{0} ({1})'...", projectName, projectConfiguration.Name), DiagnosticMessageType.Trace);
              ToggleIndeterminateProgress(true, pic_indeterminateProgress);

              List<ProjectConfigurationBuildInListViewModel> projectConfigurationBuilds =
                _agentService.GetProjectConfigurationBuilds(projectName, projectConfiguration.Name, _MaxProjectConfigurationBuildsCount, ProjectConfigurationBuildFilter.Empty)
                  .Select(pcb => new ProjectConfigurationBuildInListViewModel { ProjectConfigurationBuild = pcb })
                  .ToList();

              lock (_projectConfigurationBuildsRequestsMutex)
              {
                if (requestNumber != _projectConfigurationBuildsRequestsCounter)
                {
                  // don't update UI because there already was a new request
                  return;
                }

                GuiUtils.BeginInvoke(this, () => dgv_projectConfigurationBuilds.DataSource = projectConfigurationBuilds);
              }
            }
            catch (Exception exc)
            {
              HandleThreadException(exc);
            }
            finally
            {
              ToggleIndeterminateProgress(false, pic_indeterminateProgress);
              LogMessage(string.Format("Done loading project configuration builds for project configuration: '{0} ({1})'.", projectConfiguration.ProjectName, projectConfiguration.Name), DiagnosticMessageType.Trace);
            }
              });
        }