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;
        }
        public ProjectInfoInListViewModel(ProjectInfo projectInfo)
        {
            if (projectInfo == null)
              {
            throw new ArgumentNullException("projectInfo");
              }

              ProjectInfo = projectInfo;
        }
示例#3
0
        public void LoadProjectInfo(ProjectInfo projectInfo)
        {
            if (projectInfo == null)
              {
            throw new ArgumentNullException("projectInfo");
              }

              Text = "Project: " + projectInfo.Name;
              lbl_projectType.Text = projectInfo.Type;

              projectPropertiesPropertyGrid.SelectedObject =
            ViewModelMapper.Map<ProjectInfo, ProjectInfoInPropertyGridViewModel>(projectInfo);
        }
示例#4
0
 private static ProjectViewModel CreateProjectViewModel(ProjectInfo pi)
 {
     return new ProjectViewModel
       {
     Name = pi.Name,
     Type = (ProjectTypeViewModel)Enum.Parse(typeof(ProjectTypeViewModel), pi.Type.ToString(), true),
     AllowedEnvironmentNames = pi.AllowedEnvironmentNames,
       };
 }
示例#5
0
        private void OpenProjectTargetFolder(ProjectInfo projectInfo, EnvironmentInfo environmentInfo)
        {
            List<string> projectTargetFolders =
            _agentService.GetProjectTargetFolders(
              projectInfo.Name,
              environmentInfo.Name);

              if (projectTargetFolders.Count == 1)
              {
            SystemUtils.OpenFolder(projectTargetFolders[0]);
              }
              else
              {
            new OpenTargetFoldersForm(projectTargetFolders)
              .ShowDialog();
              }
        }
示例#6
0
        private void LoadProjectConfigurations(ProjectInfo projectInfo)
        {
            GuiUtils.BeginInvoke(
            this,
            () =>
              {
            dgv_projectConfigurations.DataSource = null;

            txtFilterConfigs.Text = "";
            txtFilterBuilds.Text = "";
              });

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

              lock (_projectConfigurationsRequestsMutex)
              {
                _projectConfigurationsRequestsCounter++;
                requestNumber = _projectConfigurationsRequestsCounter;
              }

              LogMessage(string.Format("Loading project configurations for project: '{0}'...", projectInfo.Name), DiagnosticMessageType.Trace);
              ToggleIndeterminateProgress(true, pic_indeterminateProgress);

              List<ProjectConfigurationInListViewModel> projectConfigurations;

              try
              {
                projectConfigurations =
                  _agentService.GetProjectConfigurations(projectInfo.Name, ProjectConfigurationFilter.Empty)
                    .Select(pc => new ProjectConfigurationInListViewModel(projectInfo.Name, pc))
                    .ToList();
              }
              catch (FaultException<ProjectNotFoundFault>)
              {
                LogMessage(string.Format("Project with artifacts repository name '{0}' couldn't be found.", projectInfo.ArtifactsRepositoryName), DiagnosticMessageType.Warn);

                projectConfigurations = new List<ProjectConfigurationInListViewModel>();
              }

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

                GuiUtils.BeginInvoke(this, () => dgv_projectConfigurations.DataSource = projectConfigurations);
              }
            }
            catch (Exception exc)
            {
              HandleThreadException(exc);
            }
            finally
            {
              ToggleIndeterminateProgress(false, pic_indeterminateProgress);
              LogMessage(string.Format("Done loading project configurations for project: '{0}'.", projectInfo.Name), DiagnosticMessageType.Trace);
            }
              });
        }