예제 #1
0
 private void connectButton_Click(object sender, EventArgs e)
 {
     if (GameSocket.Connected)
     {
         CommonUIFunctions.SendNotification("Already connected!");
     }
     else
     {
         Connect(DebugProtoclAdress, GameSocket);
         if (GameSocket.Connected)
         {
             statusLabel.Text = "Status: Connected";
             CommonUIFunctions.SendNotification("Connected!");
             DataRecieveWorker.RunWorkerAsync();
         }
         else
         {
             statusLabel.Text = "Status: Error";
             CommonUIFunctions.SendNotification("Failed to connect!");
         }
     }
 }
예제 #2
0
 private void frmDebug_FormClosing(object sender, FormClosingEventArgs e)
 {
     DataRecieveWorker.CancelAsync();
     GameSocket.Close();
 }