static void CopyProjectRowInfo(ProjectTagI row, ProjectI sourceRow) { row.server = sourceRow.server; row.activity = sourceRow.activity; row.queuename = sourceRow.queuename; row.weburl = sourceRow.weburl; row.buildstage = sourceRow.buildstage; row.buildstatus = sourceRow.buildstatus; row.status = sourceRow.status; row.lastbuilddate = sourceRow.lastbuilddate; row.lastbuildlabel = sourceRow.lastbuildlabel; row.nextbuildtime = sourceRow.nextbuildtime; row.details = sourceRow.details; row.icon = sourceRow.icon; row.types = sourceRow.types; row.forcer = sourceRow.forcer; row.currentProjectChilds = sourceRow.currentProjectChilds; row.projectChilds = sourceRow.projectChilds; }
ProjectTagI UpdateTag(TagKey fullName, ProjectI sourceRow) { ProjectTagI row; if (projectTagsDict.TryGetValue(fullName, out row)) { CopyProjectRowInfo(row, sourceRow); } else { row = new ProjectTagI(); row.farm = sourceRow.farm; row.name = sourceRow.name; row.tag = fullName.Tag; CopyProjectRowInfo(row, sourceRow); projectTagTable.Add(row); projectTagsDict.Add(fullName, row); } return(row); }
void integrator_OnProjectListChanged(DXCCTrayIntegrator integrator) { try { object update = new object(); List <ProjectI> projectsWithChildsToReload = new List <ProjectI>(); foreach (ProjectInfo info in integrator.ProjectList) { ProjectI row; if (!projectDict.TryGetValue(new ProjectKey(integrator.Name, info.Name), out row)) { row = new ProjectI(); row.name = info.Name; ProjectTagCollection ptc = new ProjectTagCollection(info.Tags.ToArray()); row.tags = ptc; row.tag = info.TagsString; projectTable.Add(row); projectDict.Add(new ProjectKey(integrator.Name, info.Name), row); } else { if (row.tag != info.TagsString) { ProjectTagCollection ptc = new ProjectTagCollection(info.Tags.ToArray()); row.tags = ptc; row.tag = info.TagsString; } } row.farm = integrator.Name; row.server = info.Server; row.activity = info.Activity.ToString(); row.queuename = info.QueueName; row.weburl = info.WebURL; row.buildstage = info.BuildStage; row.buildstatus = info.BuildStatus; row.status = GetStatus(info.Status); row.lastbuilddate = info.LastBuildDate; row.lastbuildlabel = info.LastBuildLabel; row.nextbuildtime = info.NextBuildTime; row.types = info.TypesString; row.IsBuildIfModification = info.IsBuildIfModification; if (row.projectChilds.Count == info.ProjectsChilds.Count) { foreach (ProjectI child in row.projectChilds) { if (!info.ProjectsChilds.Contains(child.name)) { projectsWithChildsToReload.Add(row); break; } } } else { projectsWithChildsToReload.Add(row); } row.Update = update; } ReloadProjectChilds(integrator, projectsWithChildsToReload); for (int i = 0; i < projectTable.Count; i++) { ProjectI row = projectTable[i]; if (row.farm == integrator.Name && row.Update != update) { projectDict.Remove(new ProjectKey(row.farm, row.name)); projectTable.RemoveAt(i); i--; } } } catch (Exception ex) { Log.Error("error", ex); throw; } }