public static int GetPosition(List <RecordItem> list, RecordItem item) { if (list == null || list.Count == 0) { return(0); } return(list.IndexOf(list.First(x => x.Time >= item.Time))); }
public static void AddRecord(List <RecordItem> list, RecordItem item) { list.Insert(GetPosition(list, item), item); AmateurList = list; }