Пример #1
0
        public bool AddLocation(Location location)
        {
            var all = AllLocations.ToList();

            if (all.Any(x => x == location))
            {
                return(false);
            }
            all.Add(location);
            UpdateLocations(all);
            return(true);
        }
Пример #2
0
 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);
 }