public AlbumRow(Controller c, Album a) { _controller = c; _model = a; InitializeComponent(); this.albumName.Text = _model.getName(); }
public SongRow(Controller c, Song s, Album a, AddAlbum view) { _controller = c; _model = s; _parent = a; _view = view; InitializeComponent(); this.songName.Text = _model.getName(); this.lengthLabel.Text = parseTime(_model.getlength()); }
public bool addAlbum(Album a) { try { albums.Add(a); } catch { return false; } return true; }
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; }
internal void removeAlbum(Album albumHighlight) { albums.Remove(albumHighlight); }
internal void addAlbum() { albumHighlight = new Album("No Name"); AddAlbum addAlbumView = new AddAlbum(this, albumHighlight, null); addAlbumView.Show(); }
public void songClick(SongRow row, Song s, Album a, AddAlbum view) { foreach(SongRow srow in view.getSongRows()) srow.setNormal(); row.setGreen(); songHighlight = s; view.enableEdit(); }
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); }
private Album albumParser(XmlNodeReader reader) { string name = reader.GetAttribute("name"); Album a = new Album(name); while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { if (reader.Name == "song") { Song s = new Song(); reader.Read(); reader.Read(); s.setName(reader.Value); reader.Read(); reader.Read(); reader.Read(); s.setLength(reader.Value); a.addSong(s); } if (reader.Name == "reviewer") { Review r = new Review(reader.GetAttribute("ref")); reader.Read(); r.setReview(reader.Value); a.addReview(r); } } else if (reader.NodeType == XmlNodeType.EndElement) if (reader.Name == "album") break; } return a; }