示例#1
0
        public AlbumRow(Controller c, Album a)
        {
            _controller = c;
            _model = a;
            InitializeComponent();

            this.albumName.Text = _model.getName();
        }
示例#2
0
        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());
        }
示例#3
0
 public bool addAlbum(Album a)
 {
     try
     {
         albums.Add(a);
     }
     catch
     {
         return false;
     }
     return true;
 }
示例#4
0
        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();
        }
示例#5
0
        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();
        }
示例#6
0
        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;
        }
示例#7
0
 internal void removeAlbum(Album albumHighlight)
 {
     albums.Remove(albumHighlight);
 }
示例#8
0
 internal void addAlbum()
 {
     albumHighlight = new Album("No Name");
     AddAlbum addAlbumView = new AddAlbum(this, albumHighlight, null);
     addAlbumView.Show();
 }
示例#9
0
        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();
        }
示例#10
0
        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);
        }
示例#11
0
        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;
        }