Exemplo n.º 1
0
        private async void ChangeRoom(object sender, RoutedEventArgs e)
        {
            busy = true;
            Room room    = (Room)((Button)sender).DataContext;
            var  creater = new RoomCreate(room);
            var  result  = await creater.ShowAsync();

            if (result == ContentDialogResult.Primary)
            {
                room.name = creater.getInputted()[0];
                if (!(room is SimulatorRoom))
                {
                    room.addres = creater.getInputted()[1];
                    int port = 80;

                    Int32.TryParse(creater.getInputted()[2], out port);
                    room.port     = port;
                    room.username = creater.getInputted()[3];
                    if (room.username == "" || room.username == " ")
                    {
                        room.username = null;
                    }
                }
                saveRooms();
            }
            busy = false;
        }
Exemplo n.º 2
0
        private async void Addroom_OnClick(object sender, RoutedEventArgs e)
        {
            var creater = new RoomCreate();
            var result  = await creater.ShowAsync();

            if (result == ContentDialogResult.Primary)
            {
                var room = new Room(rooms.Count, creater.getInputted()[0], creater.getInputted()[1],
                                    80, creater.getInputted()[3]);
                int port = 80;
                Int32.TryParse(creater.getInputted()[2], out port);
                room.port = 80;
                rooms.Add(room);
                saveRooms();
            }
        }