void assignToSelection() { SelectionSetVM newSet = new SelectionSetVM(_selectedMaterialIndex); foreach (var filter in Filters) { foreach (var item in filter.FilterItems) { if (item.IsSelected) { newSet.SelectedFilterValues.Add(new FilterSelection(filter.Name, item.Name)); } } } foreach (var elem in Elements) { if (elem.Include) { newSet.ElementsIdsToInclude.Add(elem.UniqueID); } if (elem.Exclude) { newSet.ElementsIdsToExclude.Add(elem.UniqueID); } } SelectionSets.Add(newSet); processSelectionSet(newSet); UpdateAll(); }
void processSelectionSet(SelectionSetVM set) { foreach (var elem in Elements) { if (elem.checkElementInFilterSet(set.SelectedFilterValues) && !set.ElementsIdsToExclude.Contains(elem.UniqueID)) { elem.Material = Materials[set.SelectedMaterial].GWPMaterial; } else if (set.ElementsIdsToInclude.Contains(elem.UniqueID)) { elem.Material = Materials[set.SelectedMaterial].GWPMaterial; } } }