private void ConnectBTN_Click(object sender, RoutedEventArgs e) { FillPlayList(); if (!string.IsNullOrEmpty(FolderPathTB.Text) && Directory.Exists(FolderPathTB.Text)) { if (RoomNameTB.Text.Length > 5 && RoomPasswordTB.Password.Length > 5) { var room = new Room { UniqName = RoomNameTB.Text, Name = RoomNameTB.Text, Password = RoomPasswordTB.Password, Medias = Playlist }; if (room.ConntectToRoom()) { room.Medias = Playlist; room.PlaylistPath = FolderPathTB.Text; PlayerForm playerForm = new PlayerForm(room, false); playerForm.Show(); this.Close(); } else { System.Windows.MessageBox.Show("Something went wrong....", "Sync Player"); } } else { RoomNameTB.Clear(); RoomPasswordTB.Clear(); } } else { System.Windows.MessageBox.Show("You did not select playlist folder, or folder does not exist", "Filmst"); } }
private void CreateRoomBTN_Click(object sender, RoutedEventArgs e) { FillPlayList(); if (Playlist.Count != 0) { if (RoomNameTB.Text.Length > 5 && RoomPasswordTB.Password.Length > 5) { var room = new Room { UniqName = RoomNameTB.Text, Name = RoomNameTB.Text, Password = RoomPasswordTB.Password, Medias = Playlist }; if (room.CreateRoom()) { room.Medias = Playlist; room.PlaylistPath = FolderPathTB.Text; PlayerForm playerForm = new PlayerForm(room, true); playerForm.Show(); this.Close(); } else { System.Windows.MessageBox.Show("Something went wrong....", "Filmst"); } } else { RoomNameTB.Clear(); RoomPasswordTB.Clear(); } } else { System.Windows.MessageBox.Show("You did not select playlist folder, or folder does not contain files with available formats", "Filmst"); } }