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; } }
public Int32 RestartAgentGroup(string GroupNameToRestart) { return(Coordinator.RestartAgentGroup(GroupNameToRestart)); }
public Int32 Method(Hashtable InParameters, ref Hashtable OutParameters) { return(Coordinator.Method(InParameters, ref OutParameters)); }
public List <AgentInfo> GetAvailableAgents(Hashtable RequestedConfiguration) { return(Coordinator.GetAvailableAgents(RequestedConfiguration)); }
public Int32 GetUniqueHandle() { return(Coordinator.GetUniqueHandle()); }
public PingResponse Ping(AgentInfo Agent) { return(Coordinator.Ping(Agent)); }
private void RestartAllAgentsButton_Click(object sender, EventArgs e) { Coordinator.RestartAllAgents(); }
private void RestartQAAgentsButton_Click(object sender, EventArgs e) { Coordinator.RestartAgentGroup("QATestGroup"); }