Example #1
0
        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++;
                }
            }
        }
Example #2
0
        public void showClick(ShowRow row, Show s)
        {
            //Set them all normal
            foreach (ShowRow r in ((MainView)_current_view).getShowRows())
                r.setNormal();

            //set ours green
            row.setGreen();

            showRowHighlight = row;
            showHighlight = s;

            //enable show buttons
            ((MainView)_current_view).enableEdit(MainView.BAND_TAB_SHOW);
            ((MainView)_current_view).enableDelete(MainView.BAND_TAB_SHOW);
        }
Example #3
0
 public int getIndexOfShowRow(ShowRow r)
 {
     return showRows.IndexOf(r);
 }