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; }
private string GetTransitionClass(StatusStripCell cell1, StatusStripCell cell2) { return string.Format ("{0}_{1}", GetStatusColor (cell1.Status), GetStatusColor (cell2.Status)); }
public string GetCss(StatusStripCell next) { if (IsHeader && next == null) return "cell-header stripend"; else if (IsHeader) return "cell-header"; string css1 = StatusToCss (Status); string css2 = string.Empty; if (next == null) css2 = "stripend"; else if (string.IsNullOrEmpty (Text) && string.IsNullOrEmpty (next.Text)) return string.Format ("{0}", css1); else css2 = GetTransitionClass (this, next); return string.Format ("{0} {1}", css1, css2); }
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; }
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; }