示例#1
0
 public void UpdateStatus(AgentStatus status)
 {
     if (lbStatus.InvokeRequired)
     {
         var refresh = new RefreshAgentStatus(UpdateStatus);
         this.Invoke(refresh, new object[] { status });
     }
     else
     {
         if (status == AgentStatus.ONLINE)
         {
             if (!string.Equals(lbStatus.Text, status.ToString()))
             {
                 lbStatus.Text      = status.ToString();
                 lbStatus.BackColor = System.Drawing.Color.LimeGreen;
                 lbStatus.ForeColor = System.Drawing.Color.Black;
             }
         }
         else
         {
             if (status == AgentStatus.ERROR || status == AgentStatus.OFFLINE)
             {
                 if (!string.Equals(lbStatus.Text, status.ToString()))
                 {
                     lbStatus.Text      = status.ToString();
                     lbStatus.BackColor = System.Drawing.Color.Red;
                     lbStatus.ForeColor = System.Drawing.Color.White;
                 }
             }
         }
     }
 }
示例#2
0
 public void UpdateManagerUI(MainForm mf)
 {
     mf.lblManagerGreed.Text      = "GRD: " + Greed.ToString();
     mf.lblManagerIQ.Text         = "INT: " + Intelligence.ToString();
     mf.lblManagerNegotiate.Text  = "NEG: " + Negotiating.ToString();
     mf.lblManagerPower.Text      = "POW: " + Power.ToString();
     mf.lblManagerScouting.Text   = "SCT: " + Scouting.ToString();
     mf.lblManagerEfficiency.Text = "EFF: " + CurrentEfficiency.ToString();
     mf.lblManagerStatus.Text     = "Status: " + Status.ToString();
 }
示例#3
0
        /// <summary>
        /// Updates the agent status.
        /// </summary>
        /// <param name="agentStatus">The agent status.</param>
        private void UpdateAgentStatus(AgentStatus agentStatus)
        {
            _agent.Status = agentStatus.ToString();

            Task task = Task.Run(async() =>
            {
                await _apiClient.AgentProcessor.Update(_agent);
            }, _mainCancellationToken);

            task.Wait(_mainCancellationToken);
        }
示例#4
0
 private int GetStatusIdx(AgentStatus status)
 {
     return(this.cmbStatus.FindStringExact(status.ToString()));
 }