コード例 #1
0
 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");
     }
 }
コード例 #2
0
 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");
     }
 }