public void AddComponentGroup(string name) { if (GetComponentGroup(name) == null) { ComponentGroup componentGroup = new ComponentGroup(name); componentGroup.ViewSource.Source = ComponentList; ComponentGroupCollection.Add(componentGroup); } }
public void UpdateGroupCollection() { string tempFilterText = ComponentSearchFilter; ComponentSearchFilter = ""; for (int i = ComponentGroupCollection.Count - 1; i >= 0; i--) { if (ComponentGroupCollection[i].Name != "Miscellaneous" && ComponentGroupCollection[i].ViewSource.View.IsEmpty) { ComponentGroupCollection.RemoveAt(i); } } ComponentSearchFilter = tempFilterText; }
public ComponentGroup GetComponentGroup(string name) { return(ComponentGroupCollection.Where(group => group.Name == name).FirstOrDefault()); }