示例#1
0
 public RoomsDialog(mode dialogMode, RoomsPage page, int fieldID = -1) : this()
 {
     CurMode = dialogMode;
     ID      = fieldID;
     CurPage = page;
     FillFields();
 }
        public RoomsPage GoToRoomsPage()
        {
            wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementIsVisible(account)).Click();
            driver.FindElement(accountRooms).Click();
            var room = new RoomsPage(driver, wait);

            return(room);
        }
示例#3
0
        private void table_rooms_Click(object sender, RoutedEventArgs e)
        {
            // Объявляем экземпляр страницы, которая содержит таблицу комнат, заодно инициализируем отступ сверху в 10 пикселей
            RoomsPage p = new RoomsPage(this)
            {
                Margin = new Thickness(0, 10, 0, 0)
            };

            // В метод AddNewTab передаём ссылку на страницу и название вкладки, в которой будет находиться эта страница
            AddNewTab(p, "Комнаты");
        }
        public InfoRooms(RoomsPage rp)
        {
            InitializeComponent();
            roomsPage = rp;

            AddRoomPageViewModel.Name  = roomsPage.selectedItem.myRoom.Name;
            AddRoomPageViewModel.Count = roomsPage.selectedItem.myRoom.Count;
            AddRoomPageViewModel.Type  = roomsPage.selectedItem.myRoom.Type;
            AddRoomPageViewModel.Key   = roomsPage.selectedItem.myRoom.Key;

            this.BindingContext        = AddRoomPageViewModel;
            DevicesList.BindingContext = roomsPage.selectedItem.myRoom.RoomDevice;
        }
示例#5
0
 public void TestInitialize()
 {
     MockRepo  = new TestRoomsRepo();
     PageModel = new RoomsPage((IRoomsRepo)MockRepo);
 }
示例#6
0
        public AddRoomPage(RoomsPage rp, bool isedit = false)
        {
            InitializeComponent();
            roomsPage = rp;
            isEdit    = isedit;


            AllRooms = new Dictionary <Temp, string>();


            for (int i = 0; i < roomsPage.mainPage.arduino.MyTemp.Count; i++)
            {
                // if (roomsPage.mainPage.arduino.MyTemp[i].MyRoom == null)

                if (roomsPage.mainPage.arduino.MyTemp[i].isHaveRooms == false)
                {
                    // Temp t = roomsPage.mainPage.arduino.MyTemp[i];
                    AllRooms.Add(new Temp()
                    {
                        Key         = roomsPage.mainPage.arduino.MyTemp[i].Key,
                        Name        = roomsPage.mainPage.arduino.MyTemp[i].Name,
                        isHaveRooms = roomsPage.mainPage.arduino.MyTemp[i].isHaveRooms,
                        myDevice    = new Models.Device()
                        {
                            Name   = roomsPage.mainPage.arduino.MyTemp[i].myDevice.Name,
                            Id     = roomsPage.mainPage.arduino.MyTemp[i].myDevice.Id,
                            Pin    = roomsPage.mainPage.arduino.MyTemp[i].myDevice.Pin,
                            Type   = roomsPage.mainPage.arduino.MyTemp[i].myDevice.Type,
                            InRoom = new Room()
                            {
                                Type       = roomsPage.mainPage.arduino.MyTemp[i].myDevice.InRoom.Type,
                                Name       = roomsPage.mainPage.arduino.MyTemp[i].myDevice.InRoom.Name,
                                Count      = roomsPage.mainPage.arduino.MyTemp[i].myDevice.InRoom.Count,
                                Key        = roomsPage.mainPage.arduino.MyTemp[i].myDevice.InRoom.Key,
                                RoomDevice = new ObservableCollection <Temp>(roomsPage.mainPage.arduino.MyTemp[i].myDevice.InRoom.RoomDevice)
                            }
                        },

                        MyRoom = new Room()
                        {
                            Name = roomsPage.mainPage.arduino.MyTemp[i].MyRoom.Name, Type = roomsPage.mainPage.arduino.MyTemp[i].MyRoom.Type, Count = roomsPage.mainPage.arduino.MyTemp[i].MyRoom.Count, Key = roomsPage.mainPage.arduino.MyTemp[i].MyRoom.Key, RoomDevice = new ObservableCollection <Temp>(roomsPage.mainPage.arduino.MyTemp[i].MyRoom.RoomDevice)
                        },

                        Selected = false
                    }, roomsPage.mainPage.arduino.MyTemp[i].MyDeviceString);
                }
            }


            //   BindingList =  roomsPage.selectedItem.myRoom.RoomDevice;


            // this.BindingContext = this;
            DevicesList.ItemsSource = roomsPage.selectedItem.myRoom.RoomDevice;

            RoomTypePicker.ItemsSource = AvailableRooms.myAvailableRooms;
            DevicePicker.ItemsSource   = AllRooms.Values.ToList();

            if (isedit)
            {
                //  Name.Text = mainPage.addElementName;
                //  Pin.Text = mainPage.addElementPin;

                Name.Text  = roomsPage.selectedItem.myRoom.Name;
                Count.Text = roomsPage.selectedItem.myRoom.Count.ToString();

                int idx = AvailableRooms.myAvailableRooms.IndexOf(roomsPage.selectedItem.myRoom.Type);
                RoomTypePicker.SelectedIndex = idx + 1;


                RoomTypePicker.SelectedItem = AvailableRooms.myAvailableRooms[idx];
                RoomTypePicker.IsEnabled    = false;
            }
            else
            {
                //DeleteDeviceButton.IsEnabled = false;

                //   roomsPage.selectedItem = new SelectedRoom() { myRoom = new Room() { Count = 0.ToString() } };
                ///  DeleteDeviceButton.IsVisible = false;
            }
        }