コード例 #1
0
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            var server   = CCStatusConfig.GetServer(tbBuildServer.Text);
            var projects = server.GetProjects();

            clbProjects.Items.Clear();
            foreach (var project in projects)
            {
                clbProjects.Items.Add(project.Name);
            }
        }
コード例 #2
0
        private void bwStatusUpdater_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
        {
            List <CCProject> projects = null;

            try
            {
                projects = CCStatusConfig.GetSelectedProjects();
            }
            catch
            {
                return;
            }

            lvProjectStatus.Invoke((System.Action)(() => lvProjectStatus.Items.Clear()));
            foreach (var project in projects)
            {
                var imageIndex = (int)project.LastBuildStatus;
                if (project.Activity == CCActivity.Building)
                {
                    imageIndex += 2;
                }
                ListViewItem lvi = new ListViewItem(project.Name, imageIndex);
                lvi.SubItems.AddRange(new ListViewItem.ListViewSubItem[]
                {
                    new ListViewItem.ListViewSubItem(lvi, project.LastBuildStatus.ToString()),
                    new ListViewItem.ListViewSubItem(lvi, project.LastBuildTime.ToString("g"))
                });
                lvProjectStatus.Invoke((System.Action)(() => lvProjectStatus.Items.Add(lvi)));
            }
            lvProjectStatus.Invoke((System.Action)(() => lvProjectStatus.View = CCStatusConfig.CurrentView));

            if (CCStatusConfig.NotifyOnFailure)
            {
                NotifyFailures();
            }
        }