public bool AddLocation(Location location) { var all = AllLocations.ToList(); if (all.Any(x => x == location)) { return(false); } all.Add(location); UpdateLocations(all); return(true); }
public bool ReplaceLocation(Location old, Location replacement) { if (AllLocations.Contains(old)) { var all = AllLocations.ToList(); var index = all.IndexOf(old); all.Remove(old); all.Insert(index, replacement); UpdateLocations(all); return(true); } return(false); }