private SortableList <StatsDomainObject> GetStats(string mode, string filterTourType) { var list = new SortableList <StatsDomainObject>(); switch (mode) { case "Fighter": list = Registry.GetPilotStats(PilotName).FighterStatsList; break; case "Attack": list = Registry.GetPilotStats(PilotName).AttackStatsList; break; case "Bomber": list = Registry.GetPilotStats(PilotName).BomberStatsList; break; case "Vehicle/Boat": list = Registry.GetPilotStats(PilotName).VehicleBoatStatsList; break; } var filteredList = new SortableList <StatsDomainObject>(); filteredList.AddRange(list.Where(statsObj => statsObj.TourType == filterTourType)); if (filteredList.Count > 0) { filteredList.SortList("TourNumber", ListSortDirection.Ascending); } return(filteredList); }
private SortableList<StatsDomainObject> GetStats(string mode, string filterTourType) { SortableList<StatsDomainObject> list = new SortableList<StatsDomainObject>(); switch (mode) { case "Fighter": list = Registry.Instance.GetPilotStats(PilotName).FighterStatsList; break; case "Attack": list = Registry.Instance.GetPilotStats(PilotName).AttackStatsList; break; case "Bomber": list = Registry.Instance.GetPilotStats(PilotName).BomberStatsList; break; case "Vehicle/Boat": list = Registry.Instance.GetPilotStats(PilotName).VehicleBoatStatsList; break; } SortableList<StatsDomainObject> filteredList = new SortableList<StatsDomainObject>(); foreach (StatsDomainObject statsObj in list) { if (statsObj.TourType == filterTourType) filteredList.Add(statsObj); } if (filteredList.Count > 0) { filteredList.SortList("TourNumber", ListSortDirection.Ascending); } return filteredList; }