private void populateListWithServers(MasterQueryResult mqr)
        {
            if (taskProgress.InvokeRequired)
            {
                populateCallback p = new populateCallback(populateListWithServers);
                this.Invoke(p, new object[] { mqr });
                return;
            }
            if (mqr.Code == MasterQueryResult.StatusCodes.CriticalStop)
            {
                taskInProgress = false;
                MessageBox.Show(mqr.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            else
            {
                foreach (Server serv in mqr.ServerList)
                {
                    addToServerList(serv);
                }
                setProgressDesc("Querying " + serverList.Count + " servers...");

                // Create the serverqueryhandler directly as we're already in a task - doQuery is there to create the task, not to continue it.
                qhandler = new ServerQueryHandler(serverList, new QueryProgress(onProgressUpdate), new Action(onServerQueryBatchCompleted));
            }
        }
        private void populateListWithServers(MasterQueryResult mqr)
        {
            if (taskProgress.InvokeRequired)
            {
                populateCallback p = new populateCallback(populateListWithServers);
                this.Invoke(p, new object[] { mqr });
                return;
            }
            if (mqr.Code == MasterQueryResult.StatusCodes.CriticalStop)
            {
                taskInProgress = false;
                MessageBox.Show(mqr.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            else
            {
                foreach (Server serv in mqr.ServerList)
                    addToServerList(serv);
                setProgressDesc("Querying " + serverList.Count + " servers...");

                // Create the serverqueryhandler directly as we're already in a task - doQuery is there to create the task, not to continue it.
                qhandler = new ServerQueryHandler(serverList, new QueryProgress(onProgressUpdate), new Action(onServerQueryBatchCompleted));
            }
        }