예제 #1
0
        public static StatusStripRow GetHeaderRow(BuildRevision[] revs)
        {
            StatusStripRow row = new StatusStripRow ();
            row.IsHeader = true;
            row.HeaderText = "Mono - Trunk";

            foreach (var item in revs) {
                StatusStripCell cell = new StatusStripCell ();
                cell.Text = item.Author;
                //cell.Status = item.Status;

                //cell.Url = string.Format ("~/builds/msvc/{0}", item.Id);
                cell.IsHeader = true;
                row.Cells.Add (cell);
            }

            return row;
        }
예제 #2
0
        public static StatusStripRow GetRow(int hostlane, FrontPageResponse data, string header)
        {
            DBHostLane dbhostlane;
            DBLane dblane;
            DBHost dbhost;

            try {
                dbhostlane = data.HostLanes.Where (p => p.id == hostlane).FirstOrDefault ();
                dblane = data.Lanes.Where (p => p.id == dbhostlane.lane_id).FirstOrDefault ();
                dbhost = data.Hosts.Where (p => p.id == dbhostlane.host_id).FirstOrDefault ();
            } catch {
                // This generally means we couldn't find the host/lane
                return null;
            }

            StatusStripRow row = new StatusStripRow ();

            int index = data.RevisionWorkHostLaneRelation.ToList ().IndexOf (dbhostlane.id);

            DBRevisionWorkView2[] revs = data.RevisionWorkViews[index];
            IEnumerable<DBRevisionWorkView2> revisions = revs.Take (10);

            foreach (DBRevisionWorkView2 r in revisions) {
                StatusStripCell cell = new StatusStripCell ();
                cell.Text = r.revision;
                cell.Status = ConvertState (r.state);

                if ((r.state == 3 || r.state == 8) && !r.completed)
                    cell.Status = 1;

                cell.Url = string.Format (rev_link, dblane.id, dbhost.id, r.revision_id);

                row.Cells.Add (cell);
            }

            if (header == "LOOKUP")
                row.HeaderText = dbhost.host;
            else
                row.HeaderText = header;

            row.HeaderUrl = string.Format (host_link, dblane.id, dbhost.id);

            while (row.Cells.Count < 10)
                row.Cells.Add ((new StatusStripCell () { Text = string.Empty, Status = 0 }));

            return row;
        }
예제 #3
0
        public static StatusStripRow GetRow(BuildRevision[] revs)
        {
            StatusStripRow row = new StatusStripRow ();
            row.HeaderText = "msvc: windows";

            foreach (var item in revs) {
                StatusStripCell cell = new StatusStripCell ();
                cell.Text = string.Format ("{0}", item.RevisionNumber);
                cell.Status = item.Status;

                cell.Url = string.Format ("~/builds/msvc/{0}", item.Id);

                row.Cells.Add (cell);
            }

            return row;
        }