Esempio n. 1
0
        /// <summary>
        /// 添加执行器(该方法未判断索引正确性)
        /// </summary>
        /// <param name="runnerState"></param>
        public void AddRunner(RunnerState runnerState)
        {
            if (runnerState != null)
            {
                ProgressBarList runerProgressBar = new ProgressBarList();
                PlayButton      runnerButton     = new PlayButton();
                ListViewItem    myAddItem        = new ListViewItem(new string[] { runnerState.RunnerName, runnerState.NowCell, runnerState.RunDetails, runnerState.Time, runnerState.CellResult, "", runnerState.State, "" });

                if (PlayStateDictionary.ContainsKey(runnerState.State))
                {
                    runnerButton.OnChangeState(PlayStateDictionary[runnerState.State]);
                }
                else
                {
                    ErrorLog.PutInLog("unkonw runnerState find in ListView_RemoteRunnerView");
                }

                if (runnerState.RunnerProgress != null)
                {
                    runerProgressBar.UpdateList((runnerState.RunnerProgress).ToList());
                }
                else
                {
                    ErrorLog.PutInLog("no RunnerProgress find in ListView_RemoteRunnerView");
                }

                this.Controls.Add(runerProgressBar);
                this.Controls.Add(runnerButton);

                myAddItem.SubItems[5].Tag = runerProgressBar;
                myAddItem.SubItems[7].Tag = runnerButton;

                this.Items.Add(myAddItem);
            }
        }