Exemple #1
0
 void client1_GetPlayersCompleted(object sender, ServiceReference1.GetPlayersCompletedEventArgs e)
 {
     try
     {
         lstbox.Items.Clear();
         foreach (var item in e.Result)
         {
             lstbox.Items.Add(item.PlayerName + " " + item.PlayerId);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
 void client1_GetPlayersCompleted(object sender, ServiceReference1.GetPlayersCompletedEventArgs e)
 {
     try
     {
         lstbox.Items.Clear();
         foreach (var item in e.Result)
         {
             if (item.AlreadExist)
             {
                 MessageBox.Show("Please enter another Nickname");
                 return;
             }
             else
             {
                 lstbox.Items.Add(item.PlayerName);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }