Пример #1
0
        public void Refresh()
        {
            OnRefreshing();

            try {
                jobs = new HiveItemCollection <RefreshableJob>();
                var jobsLoaded = HiveServiceLocator.Instance.CallHiveService <IEnumerable <Job> >(s => s.GetJobs());

                foreach (var j in jobsLoaded)
                {
                    jobs.Add(new RefreshableJob(j));
                }
            }
            catch {
                jobs = null;
                throw;
            }
            finally {
                OnRefreshed();
            }
        }
Пример #2
0
        public void Refresh()
        {
            OnRefreshing();

            try {
                projects      = new ItemList <Project>();
                resources     = new ItemList <Resource>();
                jobs          = new HiveItemCollection <RefreshableJob>();
                projectNames  = new Dictionary <Guid, string>();
                resourceNames = new Dictionary <Guid, string>();

                projectAncestors    = new Dictionary <Guid, HashSet <Guid> >();
                projectDescendants  = new Dictionary <Guid, HashSet <Guid> >();
                resourceAncestors   = new Dictionary <Guid, HashSet <Guid> >();
                resourceDescendants = new Dictionary <Guid, HashSet <Guid> >();

                HiveServiceLocator.Instance.CallHiveService(service => {
                    service.GetProjects().ForEach(p => projects.Add(p));
                    service.GetSlaveGroups().ForEach(g => resources.Add(g));
                    service.GetSlaves().ForEach(s => resources.Add(s));
                    service.GetJobs().ForEach(p => jobs.Add(new RefreshableJob(p)));
                    projectNames  = service.GetProjectNames();
                    resourceNames = service.GetResourceNames();
                });

                RefreshResourceGenealogy();
                RefreshProjectGenealogy();
                RefreshDisabledParentProjects();
                RefreshDisabledParentResources();
            } catch {
                jobs      = null;
                projects  = null;
                resources = null;
                throw;
            } finally {
                OnRefreshed();
            }
        }
Пример #3
0
        public void Refresh()
        {
            OnRefreshing();

            try {
                jobs = new HiveItemCollection <RefreshableJob>();
                var jobsLoaded = HiveServiceLocator.Instance.CallHiveService <IEnumerable <Job> >(s => s.GetJobs());

                try {
                    foreach (var j in jobsLoaded)
                    {
                        jobs.Add(new RefreshableJob(j));
                    }
                } catch (NullReferenceException) {
                    // jobs was set to null during ClearHiveClient
                }
            } catch {
                jobs = null;
                throw;
            } finally {
                OnRefreshed();
            }
        }