private void ApplyChangesButton_Click(object sender, EventArgs e)
        {
            ApplyChangesButton.Enabled = false;
            try
            {
                m_server.ApplyChanges();
            }
            catch (Exception exception)
            {
                var se = exception as ServiceResultException;

                if (se == null || se.StatusCode != StatusCodes.BadServerHalted)
                {
                    Opc.Ua.Client.Controls.ExceptionDlg.Show(Parent.Text, exception);
                }
            }

            try
            {
                m_server.Disconnect();
            }
            catch (Exception)
            {
                // ignore.
            }
        }
Ejemplo n.º 2
0
 private void DisconnectButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (m_server.IsConnected)
         {
             m_server.Disconnect();
             UpdateStatus(true, DateTime.UtcNow, "Disconnected {0}", m_server.Endpoint);
             ServerStatusPanel.Initialize(null);
         }
     }
     catch (Exception exception)
     {
         ExceptionDlg.Show(this.Text, exception);
     }
 }