Exemple #1
0
        public JoinRoomPage(Communicator communicator, Responses.GetRooms getRoomsResponses, mainManu mainMenuWindow)
        {
            InitializeComponent();
            this.communicator   = communicator;
            this.mainMenuWindow = mainMenuWindow;

            for (int i = 0; i < getRoomsResponses.rooms.Count; i++)
            {
                ListBox.Items.Add($"{getRoomsResponses.rooms[i].name} ------> {getRoomsResponses.rooms[i].id}");
            }
        }
Exemple #2
0
        private void JoinRoomButton_Click(object sender, RoutedEventArgs e)
        {
            MediaPlayer m = new MediaPlayer();

            string path = System.IO.Path.GetFullPath("digi_plink.wav");

            m.Open(new Uri(path, UriKind.RelativeOrAbsolute));
            m.Play();

            Responses.GetRooms getRoomsResponse = this.communicator.submitRequest<Responses.GetRooms>((int)Defs.Codes.GET_ROOMS_REQUEST);

            if (getRoomsResponse.status == 0)
            {
                MessageBox.Show($"Get rooms faild...");
            }
            else
            {
                pages.JoinRoomPage joinRoomPage = new pages.JoinRoomPage(this.communicator, getRoomsResponse, this);
                frame1.NavigationService.Navigate(joinRoomPage);
            }
        }