예제 #1
0
 private void Server_ConnectionStatusChanged(object sender, EventArgs e)
 {
     if (Object.ReferenceEquals(sender, m_server))
     {
         if (m_server.IsConnected)
         {
             ServerStatusPanel.Initialize(m_server);
         }
         else
         {
             ServerStatusPanel.Initialize(null);
         }
     }
 }
예제 #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);
     }
 }
예제 #3
0
        private void Server_StatusNotification(MonitoredItem monitoredItem, MonitoredItemNotificationEventArgs e)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new MonitoredItemNotificationEventHandler(Server_StatusNotification), monitoredItem, e);
                return;
            }

            try
            {
                MonitoredItemNotification notification = (MonitoredItemNotification)e.NotificationValue;
                ServerStatusPanel.SetServerStatus(notification.Value.GetValue <ServerStatusDataType>(null));
            }
            catch (Exception exception)
            {
                ExceptionDlg.Show(this.Text, exception);
            }
        }
예제 #4
0
        private async void ConnectButton_ClickAsync(object sender, EventArgs e)
        {
            try
            {
                ConfiguredEndpoint endpoint = (ConfiguredEndpoint)ServerUrlTextBox.Tag;

                if (endpoint == null)
                {
                    return;
                }

                await m_server.Connect(endpoint.Description.EndpointUrl);

                ServerStatusPanel.Initialize(m_server);
                await CertificatePanel.Initialize(m_configuration, m_gds, m_server, m_registeredApplication, false);
            }
            catch (Exception exception)
            {
                ExceptionDlg.Show(this.Text, exception);
            }
        }