按开始排序后更新结束?
for(int i = 0; i < sortedList.Count - 1; i++) { sortedList[i].End = sortedList[i+1].Start }
如果您不想在编辑最后一个元素时丢失结束值,请查看@Kevin Wells的答案
示例Select
:
var normalizedList = sortedList.Select( (e, i) => new SettingsCellItem() { Start = e.Start, End = i < sortedList.Count - 1 ? sortedList[i+1].Start : e.End }).ToList()