private void CreateRoomBTN_Click(object sender, EventArgs e) { if (Playlist.Count != 0) { var room = new Room { UniqName = RoomNameTB.Text, Name = RoomNameTB.Text, Password = RoomPasswordTB.Text, Medias = Playlist }; if (room.CreateRoom()) { PlayerForm playerForm = new PlayerForm(Playlist); playerForm.ShowDialog(); this.Close(); } else { MessageBox.Show("Something went wrong....", "Filmst"); } } else { MessageBox.Show("Fill playlist", "Filmst"); } }
private void ConnectBTN_Click(object sender, EventArgs e) { if (Playlist.Count != 0) { var room = new Room { UniqName = RoomNameTB.Text, Name = RoomNameTB.Text, Password = RoomPasswordTB.Text }; if (room.ConntectToRoom()) { PlayerForm playerForm = new PlayerForm(Playlist); playerForm.ShowDialog(); this.Close(); } else { //error message } } else { MessageBox.Show("Fill playlist", "Filmst"); } }