示例#1
0
文件: SMSPhone.cs 项目: TRSASC/Lab6
 private void SMSButton_Click(object sender, EventArgs e)
 {
     CallButtonClicked = !CallButtonClicked;
     if (CallButtonClicked)
     {
         SMSButton.Text = "Stop generate calls";
         SMSGenTask     = new Task(() => {
             while (CallButtonClicked)
             {
                 simCorp.GenCall();
                 SMSGenTask.Wait(1000);
             }
         });
         SMSGenTask.Start();
     }
     else
     {
         SMSButton.Text = "Generate calls";
     }
 }