コード例 #1
0
        private void UpdateGridRows()
        {
            if (Coordinator.AgentsDirty)
            {
                // Clear out any existing rows
                AgentGridView.Rows.Clear();

                // Get a list of agents
                Dictionary <string, AgentInfo> Agents = Coordinator.GetAgents();
                List <string> AgentNames = new List <string>(Agents.Keys);
                AgentNames.Sort();

                // Create a row for each agent
                foreach (string AgentName in AgentNames)
                {
                    AgentInfo               NextAgent = Agents[AgentName];
                    DataGridViewRow         Row       = new DataGridViewRow();
                    DataGridViewTextBoxCell NextCell  = null;

                    NextCell       = new DataGridViewTextBoxCell();
                    NextCell.Value = NextAgent.Name;
                    if (NextAgent.Configuration.ContainsKey("UserName"))
                    {
                        NextCell.Value += " (" + NextAgent.Configuration["UserName"] + ")";
                    }
                    else
                    {
                        NextCell.Value += " (UnknownUser)";
                    }
                    Row.Cells.Add(NextCell);

                    NextCell = new DataGridViewTextBoxCell();
                    if (NextAgent.Configuration.ContainsKey("GroupName"))
                    {
                        NextCell.Value = NextAgent.Configuration["GroupName"];
                    }
                    else
                    {
                        NextCell.Value = "Undefined";
                    }
                    Row.Cells.Add(NextCell);

                    NextCell       = new DataGridViewTextBoxCell();
                    NextCell.Value = NextAgent.Version;
                    Row.Cells.Add(NextCell);

                    NextCell = new DataGridViewTextBoxCell();
                    string NextCellStateValue;
                    if (NextAgent.State == AgentState.Working)
                    {
                        if ((NextAgent.Configuration.ContainsKey("WorkingFor")) &&
                            ((NextAgent.Configuration["WorkingFor"] as string) != ""))
                        {
                            NextCellStateValue = "Working for " + NextAgent.Configuration["WorkingFor"];
                        }
                        else
                        {
                            NextCellStateValue = "Working for an unknown Agent";
                        }
                    }
                    else
                    {
                        NextCellStateValue = NextAgent.State.ToString();
                    }
                    if ((NextAgent.Configuration.ContainsKey("AssignedTo")) &&
                        ((NextAgent.Configuration["AssignedTo"] as string) != ""))
                    {
                        NextCellStateValue += ", Assigned to " + NextAgent.Configuration["AssignedTo"];
                    }
                    else
                    {
                        NextCellStateValue += ", Unassigned";
                    }
                    NextCell.Value = NextCellStateValue;
                    Row.Cells.Add(NextCell);

                    NextCell = new DataGridViewTextBoxCell();
                    if (NextAgent.Configuration.ContainsKey("IPAddress"))
                    {
                        NextCell.Value = NextAgent.Configuration["IPAddress"];
                    }
                    else
                    {
                        NextCell.Value = "Undefined";
                    }
                    Row.Cells.Add(NextCell);

                    NextCell = new DataGridViewTextBoxCell();
                    if (NextAgent.Configuration.ContainsKey("LastPingTime"))
                    {
                        NextCell.Value = NextAgent.Configuration["LastPingTime"];
                    }
                    else
                    {
                        NextCell.Value = "Undefined";
                    }
                    Row.Cells.Add(NextCell);

                    NextCell = new DataGridViewTextBoxCell();
                    if (NextAgent.Configuration.ContainsKey("LocalAvailableCores"))
                    {
                        NextCell.Value = NextAgent.Configuration["LocalAvailableCores"];
                    }
                    else
                    {
                        NextCell.Value = "Undefined";
                    }
                    Row.Cells.Add(NextCell);

                    NextCell = new DataGridViewTextBoxCell();
                    if (NextAgent.Configuration.ContainsKey("RemoteAvailableCores"))
                    {
                        NextCell.Value = NextAgent.Configuration["RemoteAvailableCores"];
                    }
                    else
                    {
                        NextCell.Value = "Undefined";
                    }
                    Row.Cells.Add(NextCell);

                    AgentGridView.Rows.Add(Row);
                }

                Coordinator.AgentsDirty = false;
            }
        }
コード例 #2
0
 public Int32 RestartAgentGroup(string GroupNameToRestart)
 {
     return(Coordinator.RestartAgentGroup(GroupNameToRestart));
 }
コード例 #3
0
 public Int32 Method(Hashtable InParameters, ref Hashtable OutParameters)
 {
     return(Coordinator.Method(InParameters, ref OutParameters));
 }
コード例 #4
0
 public List <AgentInfo> GetAvailableAgents(Hashtable RequestedConfiguration)
 {
     return(Coordinator.GetAvailableAgents(RequestedConfiguration));
 }
コード例 #5
0
 public Int32 GetUniqueHandle()
 {
     return(Coordinator.GetUniqueHandle());
 }
コード例 #6
0
 public PingResponse Ping(AgentInfo Agent)
 {
     return(Coordinator.Ping(Agent));
 }
コード例 #7
0
 private void RestartAllAgentsButton_Click(object sender, EventArgs e)
 {
     Coordinator.RestartAllAgents();
 }
コード例 #8
0
 private void RestartQAAgentsButton_Click(object sender, EventArgs e)
 {
     Coordinator.RestartAgentGroup("QATestGroup");
 }