Example #1
0
        private void RefreshDisabledParentResources()
        {
            disabledParentResources = new HashSet <Resource>();

            foreach (var rid in resources
                     .Where(x => x.ParentResourceId.HasValue)
                     .SelectMany(x => resourceAncestors[x.Id]).Distinct()
                     .Where(x => !resources.Select(y => y.Id).Contains(x)))
            {
                var r = new SlaveGroup();
                r.Id = rid;
                r.ParentResourceId = resourceAncestors[rid].FirstOrDefault();
                r.Name             = resourceNames[rid];
                disabledParentResources.Add(r);
            }
        }
Example #2
0
        private void RefreshDisabledParentProjects()
        {
            disabledParentProjects = new HashSet <Project>();

            foreach (var pid in projects
                     .Where(x => x.ParentProjectId.HasValue)
                     .SelectMany(x => projectAncestors[x.Id]).Distinct()
                     .Where(x => !projects.Select(y => y.Id).Contains(x)))
            {
                var p = new Project();
                p.Id = pid;
                p.ParentProjectId = projectAncestors[pid].FirstOrDefault();
                p.Name            = projectNames[pid];
                disabledParentProjects.Add(p);
            }
        }