internal void highlightBand(BandRow row) { //Set highlighted one green row.setGreen(); //Set all others normal foreach (BandRow r in ((MainView)_current_view).getBandRows()) if (!r.Equals(row)) r.setNormal(); //Set it to our "focus" bandHighlight = row.getModel(); //Set up "Edit" and "Delete" Buttons ((MainView)_current_view).enableEdit(MainView.BANDS_TAB); ((MainView)_current_view).enableDelete(MainView.BANDS_TAB); //Change the band tab name ((MainView)_current_view).setBandTabName(bandHighlight.getName()); }
public void initialize(Band[] bandsSource, Reviewer[] reviewersSource) { //Bands Tab int i = 0; Control lastControl = null; foreach (Band band in bandsSource) { BandRow row = new BandRow(band, _controller, this, false); //match parent's width row.Width = bandsTab.Width; //add the row this.bandsTab.Controls.Add(row); //adjust the height row.initialize(); //move it down if (lastControl != null) row.Top = lastControl.Top + lastControl.Height; else row.Top = 0; //Store the "last control" lastControl = row; //Add it to the row list bandRows.Add((BandRow)lastControl); //increment placement i++; } //Reviewer Tab i = 0; lastControl = null; foreach (Reviewer reviewer in reviewersSource) { ReviewerRow row = new ReviewerRow(reviewer, _controller, this); //match parent's width row.Width = bandsTab.Width; //add the row this.reviewersTab.Controls.Add(row); //adjust the height row.initialize(); //move it down if (lastControl != null) row.Top = lastControl.Top + lastControl.Height; else row.Top = 0; //Store the "last control" lastControl = row; //Add it to the row list reviewerRows.Add((ReviewerRow)lastControl); //increment placement i++; } }