Exemple #1
0
 private void M_OpcUaClient_OpcStatusChange(object sender, OpcUaStatusEventArgs e)
 {
     if (!timer.Enabled)
     {
         LblStatusConnection.Invoke((MethodInvoker) delegate
         {
             LblStatusConnection.Text = e.Text;
         });
     }
 }
Exemple #2
0
 private void M_OpcUaClient_OpcStatusChange(object sender, OpcUaStatusEventArgs e)
 {
     lbl_ConnectStatus.Text = e.ToString();
     if (m_OpcUaClient.Connected)
     {
         InvokeChangeButtonText(button1, "Disconnect");
         //button1.Text = "Disconnect";
     }
     else
     {
         InvokeChangeButtonText(button1, "Connect");
         //button1.Text = "Connect";
     }
 }
Exemple #3
0
        /// <summary>
        /// OPC 客户端的状态变化后的消息提醒
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void M_OpcUaClient_OpcStatusChange1(object sender, OpcUaStatusEventArgs e)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new Action(() => { M_OpcUaClient_OpcStatusChange1(sender, e); }));
                return;
            }

            if (e.Error)
            {
                toolStripStatusLabel1.BackColor = Color.Red;
            }
            else
            {
                toolStripStatusLabel1.BackColor = SystemColors.Control;
            }

            toolStripStatusLabel_opc.Text = e.ToString();
        }
 private void Client_OpcStatusChange(object sender, OpcUaStatusEventArgs e)
 {
     StatusChangeEvent?.Invoke(IsConnected);
 }