public void reorder(Group group) { IGroupSorter sorter = GroupSorter; GroupSorter = new OrderGroupSorter(); List <Group> sortedList = getSortedGroupList(group.Division); sortedList.Reverse(); int orderNo = 0; foreach (Group g in sortedList) { if (g == group) { continue; } if (g.Order == group.Order) { group.Order = orderNo; orderNo++; g.Order = orderNo; } else { g.Order = orderNo; } orderNo++; } GroupSorter = sorter; }
public Sorter( IIoService ioService, IGrouper grouper, IGroupsLoaderFactory groupsLoaderFactory, IGroupSorter groupSorter, ISortedGroupWriterFactory groupWriterFactory, IConfig config) { _ioService = ioService; _grouper = grouper; _groupsLoaderFactory = groupsLoaderFactory; _groupSorter = groupSorter; _groupWriterFactory = groupWriterFactory; _config = config; }