public SchedulerResourceTreeView CreateResourceTreeView() { var result = new SchedulerResourceTreeView(GetResourceTreeItemCollection()); var buildings = result.ResourceTree.Buildings().Where(x => x.BuildingIsActive).OrderBy(x => x.BuildingName).ToArray(); result.Root = new TreeViewNodeCollection(buildings.Select(x => new BuildingNode(this, result, x)).ToArray()); return(result); }
public SchedulerResourceTreeView CreateLocationTreeView() { var locationTree = GetLocationTreeItemCollection(); var include = locationTree.GetLabLocations().Select(x => x.LabID).Distinct().ToArray(); var result = new SchedulerResourceTreeView(locationTree); var labs = result.ResourceTree.Labs().Where(x => x.BuildingIsActive && x.LabIsActive && include.Contains(x.LabID)).OrderBy(x => x.BuildingName).ThenBy(x => x.LabDisplayName).ToArray(); result.Root = new TreeViewNodeCollection(labs.Select(x => new LocationLabNode(this, result, locationTree, x)).ToArray()); return(result); }