private void UpdateInnerList() { var newGroupingList = CreateGroupingList(); var intersect = InnerList.Intersect(newGroupingList, innerListKeyComparer); foreach (var target in intersect) { var source = newGroupingList.First(x => innerListKeyComparer.Equals(x, target)); ListMerger.Merge(source, target, elementComparer, target.Insert, target.RemoveAt, () => target.Reset(source)); } ListMerger.Merge(newGroupingList, InnerList, innerListKeyComparer, Insert, RemoveAt, () => Reset(newGroupingList)); }
private void UpdateInnerList() { T[] newList; if (Filter != null) { newList = originalList.Where(x => Filter(x)).ToArray(); } else { newList = originalList.ToArray(); } ListMerger.Merge(newList, innerList, comparer, Insert, RemoveAt, () => Reset(newList)); }