Example #1
0
        private void ShowHosts()
        {
            Program.log.Info("Getting file hosts for Discover");

            BackGroundWorker.RunWorkAsync <List <string> >(() => GetFileHosts(), (data) => {
                if (tabDiscover.InvokeRequired)
                {
                    var b = new loadHostsCallBack(ShowHosts);
                    Invoke(b, new object[] { });
                }
                else
                {
                    dataGridDiscover.Rows.Clear();

                    int count = 1;
                    foreach (string url in data)
                    {
                        dataGridDiscover.Rows.Add(count.ToString(), url, "Web", url);
                        count += 1;
                    }

                    tab.SelectedTab = CurrentTab;
                }
            });

            Program.log.Info("Successfully loaded hosts/servers");
        }
Example #2
0
        void showHosts()
        {
            imgSpinner.Visible = true;

            BackGroundWorker.RunWorkAsync <List <string> >(() => getFileHosts(), (data) =>
            {
                if (tabDiscover.InvokeRequired)
                {
                    loadHostsCallBack b = new loadHostsCallBack(showHosts);
                    Invoke(b, new object[] { });
                }
                else
                {
                    dataGridDiscover.Rows.Clear();

                    int count = 1;
                    foreach (string url in data)
                    {
                        dataGridDiscover.Rows.Add(count.ToString(), url, "Web", url);
                        count += 1;
                    }

                    tab.SelectedTab    = currentTab;
                    imgSpinner.Visible = false;
                }
            });
        }