コード例 #1
0
        private void CmdOutput_TextChanged(object sender, EventArgs e)
        {
            bool isrunning = paexecService.IsRunning;

            KillButton.Invoke(new Action(() => KillButton.Enabled       = isrunning));
            ConnectButton.Invoke(new Action(() => ConnectButton.Enabled = isrunning));;
        }
コード例 #2
0
 private void ClientConnected(object sender, SocketEventArgs e)
 {
     ConnectButton.Invoke(new Action(() =>
     {
         ConnectButton.Enabled = false;
     }));
 }
コード例 #3
0
 private void ClientDisconnected(object sender, SocketEventArgs e)
 {
     System.Diagnostics.Debug.WriteLine("Re-enabling the start button");
     ConnectButton.Invoke(new Action(() =>
     {
         ConnectButton.Enabled = true;
     }));
 }
コード例 #4
0
 private void Port_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
 {
     // In caso di errore cambio il testo sul pulsante
     port.Close();
     if (ConnectButton.InvokeRequired)
     {
         ConnectButton.Invoke((Action)(() => UpdateText(ConnectButton, "Connect")));
         return;
     }
     else
     {
         UpdateText(ConnectButton, "Connect");
     }
 }