public void albumClick(AlbumRow row, Album album) { foreach (AlbumRow ar in ((MainView)_current_view).getAlbumRows()) ar.setNormal(); row.setGreen(); //set highlight albumHighlight = album; //enable album buttons ((MainView)_current_view).enableEdit(MainView.BAND_TAB_ALBUM); ((MainView)_current_view).enableDelete(MainView.BAND_TAB_ALBUM); ((MainView)_current_view).enableAddReview(); }
public ReviewRow(Controller c, Review r, Album a, AlbumRow row) { _controller = c; _model = r; _parent = a; _parent_row = row; InitializeComponent(); Reviewer reviewer = _controller.getReviewer(r.getReviewerId()); if (reviewer != null) this.reviewerNameLabel.Text = reviewer.getName(); this.reviewLabel.Text = r.getReview(); }
public AddAlbum(Controller c, Album a, AlbumRow r) { _controller = c; _album = a; _row = r; songRows = new List<SongRow>(); InitializeComponent(); this.nameBox.Text = a.getName(); addSongRows(a.getSongs()); if (a.getSongs().Length > 0) _isEdit = true; else _isEdit = false; }
public void reviewClick(ReviewRow row, Review r, Album a, AlbumRow arow) { foreach (ReviewRow rrow in ((MainView)_current_view).getReviewRows()) rrow.setNormal(); reviewHighlight = r; row.setGreen(); albumClick(arow, a); //enable review buttons ((MainView)_current_view).enableEdit(MainView.BAND_TAB_REVIEW); ((MainView)_current_view).enableDelete(MainView.BAND_TAB_REVIEW); }
public void initializeBandTab(Band b) { //remove exist rows foreach (AlbumRow row in albumRows) { this.bandTab.Controls.Remove(row); foreach (ShowRow srow in showRows) row.Controls.Remove(srow); } foreach (ShowRow row in showRows) this.bandTab.Controls.Remove(row); if (this.showLabel != null) this.bandTab.Controls.Remove(showLabel); this.albumRows = new List<AlbumRow>(); this.showRows = new List<ShowRow>(); this.reviewRows = new List<ReviewRow>(); this.songRows = new List<SongRow>(); int i = 0; Control lastControl = null; foreach (Album a in b.getAlbums()) { AlbumRow row = new AlbumRow(_controller, a); //match parent's width row.Width = bandsTab.Width; //add the row this.bandTab.Controls.Add(row); //adjust the height row.initialize(); //move it down if (lastControl != null) row.Top = lastControl.Top + lastControl.Height + 5; else row.Top = 0; //Store the "last control" lastControl = row; lastControl.Show(); //Add it to the row list albumRows.Add((AlbumRow)lastControl); //increment placement i++; Control lastSongControl = null; //Add songs to it foreach (Song s in a.getSongs()) { SongRow srow = new SongRow(_controller, s, a, null); srow.Width = bandsTab.Width; lastControl.Controls.Add(srow); srow.initialize(); srow.Top = lastControl.Height; lastSongControl = srow; songRows.Add(srow); srow.Visible = true; lastControl.Height += srow.Height; } Control lastReviewControl = null; int k = 0; //Add songs to it foreach (Review r in a.getReviews()) { ReviewRow rrow = new ReviewRow(_controller, r, a, row); rrow.Width = bandsTab.Width; lastControl.Controls.Add(rrow); rrow.initialize(); rrow.Top = row.Height ; lastReviewControl = rrow; reviewRows.Add(rrow); row.Height += rrow.Height; k++; } } showLabel = new Label(); showLabel.Text = "Shows"; showLabel.Font = new Font(showLabel.Font.FontFamily, 15); if(lastControl != null) showLabel.Top = lastControl.Top + lastControl.Height + 5; this.bandTab.Controls.Add(showLabel); Control lastShowControl = null; showRows = new List<ShowRow>(); int l = 0; //Add songs to it foreach (Show s in b.getShows()) { for (int m = 0; m < s.getDates().Length; m++) { ShowRow srow = new ShowRow(_controller, s, s.getVenues()[m], s.getDates()[m]); showRows.Add(srow); srow.Width = bandsTab.Width; this.bandTab.Controls.Add(srow); srow.initialize(); if (lastShowControl != null) srow.Top = lastShowControl.Top + lastShowControl.Height; else { srow.Top = showLabel.Top + showLabel.Height + 5; } lastShowControl = srow; l++; } } }