Ejemplo n.º 1
0
        private void UpdateJob(JobViewModel job)
        {
            if (!IsValid)
            {
                return;
            }

            try
            {
                Job source = JsonConvert.DeserializeObject <Job>(m_client.GetJsonAsync <Job>(job.Path).LogErrors().Result);

                if (source == null)
                {
                    return;
                }
                job.Color         = source.Color;
                job.InQueue       = source.InQueue;
                job.HealthReports = source.HealthReport;
                job.Description   = source.Description;

                UpdateLastBuild(job, source.LastBuild);
            }
            catch (Exception)
            {
            }
        }
Ejemplo n.º 2
0
		private void UpdateLastBuild(JobViewModel job, Build source)
		{
			if (job.LastBuild == null)
				job.LastBuild = new BuildViewModel();

			job.LastBuild.Number = source.Number;
			job.LastBuild.Path = source.Url;
			job.LastBuild.Building = source.Building;
			job.LastBuild.BuiltOn = source.BuiltOn;
			job.LastBuild.TimeStamp = ConvertTimestamp(source.Timestamp);
			job.LastBuild.Duration = source.Duration == 0 && source.Building ? (DateTime.UtcNow - job.LastBuild.TimeStamp) : TimeSpan.FromMilliseconds(source.Duration);
			job.LastBuild.EstimatedDuration = TimeSpan.FromMilliseconds(source.EstimatedDuration);
			job.LastBuild.Result = source.Result;
		}
Ejemplo n.º 3
0
        private void JobOnStatusChanged(object sender, StatusChangedArgs args)
        {
            JobViewModel job = (JobViewModel)sender;

            if (args.NewValue == BuildStatus.Failed)
            {
                m_notifyIcon.ShowBalloonTip(job.Name, "Build " + args.NewValue, BalloonIcon.Error);
            }
            else if (args.NewValue == BuildStatus.Success && args.OldValue < BuildStatus.Success)
            {
                m_notifyIcon.ShowBalloonTip(job.Name, "Build " + args.NewValue, BalloonIcon.Info);
            }

            SetTaskBarStatus();
        }
Ejemplo n.º 4
0
        private void UpdateLastBuild(JobViewModel job, Build source)
        {
            if (job.LastBuild == null)
            {
                job.LastBuild = new BuildViewModel();
            }

            job.LastBuild.Number            = source.Number;
            job.LastBuild.Path              = source.Url;
            job.LastBuild.Building          = source.Building;
            job.LastBuild.BuiltOn           = source.BuiltOn;
            job.LastBuild.TimeStamp         = ConvertTimestamp(source.Timestamp);
            job.LastBuild.Duration          = source.Duration == 0 && source.Building ? (DateTime.UtcNow - job.LastBuild.TimeStamp) : TimeSpan.FromMilliseconds(source.Duration);
            job.LastBuild.EstimatedDuration = TimeSpan.FromMilliseconds(source.EstimatedDuration);
            job.LastBuild.Result            = source.Result;
        }
Ejemplo n.º 5
0
		private void UpdateJob(JobViewModel job)
		{
			try
			{
				Job source = JsonConvert.DeserializeObject<Job>(m_client.GetJsonAsync<Job>(job.Path).LogErrors().Result);

				if (source == null)
					return;
				job.Color = source.Color;
				job.InQueue = source.InQueue;
				job.HealthReports = source.HealthReport;
				job.Description = source.Description;

				UpdateLastBuild(job, source.LastBuild);
			}
			catch (Exception)
			{

			}
		}
Ejemplo n.º 6
0
 public void OpenProjectDetails(JobViewModel model)
 {
     Model.SelectedProject = model;
     LoadContent("ProjectDetails");
 }
Ejemplo n.º 7
0
 public void OpenProjectDetails(JobViewModel model)
 {
     Model.SelectedProject = model;
     LoadContent("ProjectDetails");
 }