Esempio n. 1
0
        public void RemoveFloor(Floor floor)
        {
            if (!Floors.Contains(floor))
            {
                return;
            }

            var index = Floors.IndexOf(floor);

            Floors.Remove(floor);
            floor.Objects.CollectionChanged -= FloorObjectsCollectionChanged;
            floor.RemoveObjects();

            if (index >= Floors.Count - 1)
            {
                CurrentFloor = Floors.LastOrDefault();
            }
            else
            {
                CurrentFloor = Floors[index];
            }

            foreach (var f in Floors)
            {
                f.RefreshTitle();
            }

            evacuationPlan.ComposeRoutes();
        }
 public bool FloorExists(string floorChosen)
 {
     if (Floors != null && Floors.Contains(floorChosen))
     {
         return(true);
     }
     return(false);
 }
Esempio n. 3
0
        public void AddFloor(Floor floor)
        {
            if (Floors.Contains(floor))
            {
                return;
            }

            Floors.Add(floor);
            floor.RefreshTitle();
            floor.Objects.CollectionChanged += FloorObjectsCollectionChanged;

            if (CurrentFloor == null)
            {
                CurrentFloor = floor;
            }
        }