示例#1
0
        /// <summary>
        /// Alternate method for retrieving current status for all projects without
        /// exception handling, for use within other ICruiseServerManager methods
        /// to provide user feedback
        /// </summary>
        /// <returns></returns>
        public CruiseServerSnapshot GetCruiseServerSnapshotEx()
        {
            List <ProjectStatus> projectStatues = AllJobs
                                                  .Where(a => ProjectsAndCurrentStatus.ContainsKey(a.Name))
                                                  .Select(a => Api.GetProjectStatus(a.Url, ProjectsAndCurrentStatus[a.Name]))
                                                  .ToList();

            // Reset the ProjectsAndCurrentStatus dictionary
            ProjectsAndCurrentStatus = projectStatues.ToDictionary(a => a.Name);

            var snapshot = new CruiseServerSnapshot(projectStatues.ToArray(), new QueueSetSnapshot());

            return(snapshot);
        }