internal void selectReviewer(ReviewerRow reviewerRow, Reviewer _model) { //Set them all normal foreach (ReviewerRow row in ((MainView)reviewerRow.getParent()).getReviewerRows()) row.setNormal(); //Set ours green reviewerRow.setGreen(); //Make it the highlighted one reviewerHighlight = _model; //enable the buttons ((MainView)reviewerRow.getParent()).enableDelete(MainView.REVIEWER_TAB); ((MainView)reviewerRow.getParent()).enableEdit(MainView.REVIEWER_TAB); }
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++; } }