private void LoadList(List <Distance> list, DistanceStringList saved) { foreach (string s in saved) { Distance d = new Distance(); d.LoadFromString(s); list.Add(d); } }
// ZZZ - Way to use generic IPersistable type in the Persistence class? private DistanceStringList SaveList(List <Distance> list) { if (list == null) { return(new DistanceStringList()); } DistanceStringList result = new DistanceStringList(); foreach (Distance d in list) { result.Add(d.SaveToString()); } return(result); }