Esempio n. 1
0
        public static Boolean Compare(FloorDoorViewModel current, FloorDoorViewModel other)
        {
            if (current == null && other == null)
            {
                return(true);
            }
            else if (current == null || other == null)
            {
                return(false);
            }

            return((current.FloorID == other.FloorID) && (current.DoorID == other.DoorID));
        }
Esempio n. 2
0
 public void InitDoorListBox()
 {
     Doors = new ObservableCollection <FloorDoorViewModel>();
     foreach (var authDoor in FloorDoorManager.GetInstance().AuthorizationDoors)
     {
         var floorDoorViewModel = new FloorDoorViewModel();
         var bindedDoor         = FloorDoorManager.GetInstance().AuthorizationFloorDoor.FirstOrDefault(x => x.DoorID == authDoor.DeviceDoorID);
         if (bindedDoor != null)
         {
             floorDoorViewModel          = Mapper.Map <FloorDoorViewModel>(bindedDoor);
             floorDoorViewModel.DoorName = authDoor.Name;
             floorDoorViewModel.Enabled  = (bindedDoor.FloorID == 0 || bindedDoor.FloorID == FloorID);
         }
         else
         {
             floorDoorViewModel.DoorID   = authDoor.DeviceDoorID;
             floorDoorViewModel.DoorName = authDoor.Name;
             floorDoorViewModel.Enabled  = true;
         }
         Doors.Add(floorDoorViewModel);
     }
 }