Opc.Ua.SampleServer.ServerDiagnosticsCtrl.Initialize C# (CSharp) Method

Initialize() public method

Creates a form which displays the status for a UA server.
public Initialize ( StandardServer server, ApplicationConfiguration configuration ) : void
server Opc.Ua.Server.StandardServer The server displayed in the form.
configuration ApplicationConfiguration The configuration used to initialize the server.
return void
        public void Initialize(StandardServer server, ApplicationConfiguration configuration)
        {
            m_server = server;
            m_configuration = configuration;

            m_dispatcherTimer = new DispatcherTimer();
            m_dispatcherTimer.Tick += UpdateTimerCTRL_Tick;
            m_dispatcherTimer.Interval = new TimeSpan(0, 0, 5); // tick every 5 seconds
            m_dispatcherTimer.Start();

            // add the urls to the drop down.
            UrlCB.Items.Clear();

            foreach (EndpointDescription endpoint in m_server.GetEndpoints())
            {
                if (!UrlCB.Items.Contains(endpoint.EndpointUrl))
                {
                    UrlCB.Items.Add(endpoint.EndpointUrl);
                }
            }

            if (UrlCB.Items.Count > 0)
            {
                UrlCB.SelectedIndex = 0;
            }
        }
#endregion