Opc.Ua.Configuration.SelectComServerDlg.UpdateServers C# (CSharp) Method

UpdateServers() private method

Updates the list of servers.
private UpdateServers ( ) : void
return void
        private void UpdateServers()
        {
            // populate the list of servers.
            Opc.Ua.Com.ServerFactory factory = new ServerFactory();

            try
            {
                ServersLV.Items.Clear();

                string hostName = HostCB.Text;

                if (HostCB.SelectedIndex != -1)
                {
                    hostName = (string)HostCB.SelectedItem;
                }

                factory.Connect(hostName, null);

                GetAvailableServers(factory, Specification.Da20);
                GetAvailableServers(factory, Specification.Da30);
                GetAvailableServers(factory, Specification.Ae10);
                GetAvailableServers(factory, Specification.Hda10);

                for (int ii = 0; ii < ServersLV.Columns.Count; ii++)
                {
                    ServersLV.Columns[ii].Width = -2;
                }
            }
            finally
            {
                factory.Disconnect();
            }
        }