public GridItem(OfflineDeploymentRun data) { this.OfflineDeploymentRunId = data.Id; this.StatusDisplayValue = EnumHelper.GetDisplayValue(data.DeployBatchRequest.Status); switch(data.DeployBatchRequest.Status) { case EnumDeployStatus.Cancelled: this.StatusIconImage = Resources.StatusAnnotations_Stop_32xSM_color; break; case EnumDeployStatus.Error: this.StatusIconImage = Resources.StatusAnnotations_Critical_32xSM_color; break; case EnumDeployStatus.InProcess: this.StatusIconImage = Resources.StatusAnnotations_Play_32xSM_color; break; case EnumDeployStatus.NotStarted: this.StatusIconImage = Resources.StatusAnnotations_Help_and_inconclusive_32xSM_color; break; case EnumDeployStatus.Success: this.StatusIconImage = Resources.StatusAnnotations_Complete_and_ok_32xSM_color; break; default: this.StatusIconImage = Resources.StatusAnnotations_Alert_32xSM_color; break; } if(data.DeployBatchRequest.StartedDateTimeUtc.HasValue) { this.StartedDateDisplayValue = WinFormsHelper.LocalDateText(data.DeployBatchRequest.StartedDateTimeUtc.Value); } if(data.DeployBatchRequest.CompleteDateTimeUtc.HasValue) { this.StartedDateDisplayValue = WinFormsHelper.LocalDateText(data.DeployBatchRequest.CompleteDateTimeUtc.Value); } }
public RunDeploymentForm(IDIFactory diFactory, OfflineDeploymentRun offlineDeploymentRun, string workingDirectory) { InitializeComponent(); _offlineDeploymentRunId = offlineDeploymentRun.Id; _batchRequest = offlineDeploymentRun.DeployBatchRequest; _selectionList = offlineDeploymentRun.SelectionList; _workingDirectory = workingDirectory; _diFactory = diFactory; }
public void Initialize(string offlineDeploymentRunId, DeployBatchRequest deployBatchRequest, List<OfflineComponentSelection> selectionList, string workingDirectory) { if(!string.IsNullOrEmpty(offlineDeploymentRunId)) { string runDirectory = Path.Combine(workingDirectory, "runs"); string runFileName = Path.Combine(runDirectory, offlineDeploymentRunId + ".json"); if (!File.Exists(runFileName)) { throw new FileNotFoundException("Missing run file", runFileName); } var json = File.ReadAllText(runFileName); _deploymentRun = JsonConvert.DeserializeObject<OfflineDeploymentRun>(json); } else { _deploymentRun = new OfflineDeploymentRun { Id = Guid.NewGuid().ToString(), DeployBatchRequest = deployBatchRequest, SelectionList = selectionList }; } _workingDirectory = workingDirectory; }