示例#1
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            Song aSong = new Song();
            FormSong Songs = new FormSong(aSong);

            if (Songs.ShowDialog() == DialogResult.OK)
                SongList.Add(aSong);
        }
示例#2
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            Song aSong = new Song();
            FormSong Songs = new FormSong(aSong);

            if (Songs.ShowDialog() == DialogResult.OK)
                _MediaCollection.MediaList.Add(aSong);
                buttonEdit.Enabled = true;
                buttonDelete.Enabled = true;
        }
示例#3
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            Song     aSong = new Song();
            FormSong Songs = new FormSong(aSong);

            if (Songs.ShowDialog() == DialogResult.OK)
            {
                SongList.Add(aSong);
            }
        }
示例#4
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            Song     aSong = new Song();
            FormSong Songs = new FormSong(aSong);

            if (Songs.ShowDialog() == DialogResult.OK)
            {
                _MediaCollection.MediaList.Add(aSong);
            }
            buttonEdit.Enabled   = true;
            buttonDelete.Enabled = true;
        }
示例#5
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedItem != null)
            {
                Song     aSong = listBox1.SelectedItem as Song;
                FormSong Songs = new FormSong(aSong);

                Song song1 = new Song();
                song1.SongName          = aSong.SongName;
                song1.ArtistName        = aSong.ArtistName;
                song1.AlbumName         = aSong.AlbumName;
                song1.YearReleased      = aSong.YearReleased;
                song1.DurationInSeconds = aSong.DurationInSeconds;
                song1.TrackNumber       = aSong.TrackNumber;
                song1.TrackCount        = aSong.TrackCount;
                song1.Genre             = aSong.Genre;
                song1.MyRating          = aSong.MyRating;



                if (Songs.ShowDialog() == DialogResult.OK)
                {
                    //ListBox Refresh
                    _MediaCollection.MediaList.Add(aSong);
                    _MediaCollection.MediaList.Remove(aSong);
                }
                else
                {
                    aSong.SongName          = song1.SongName;
                    aSong.ArtistName        = song1.ArtistName;
                    aSong.AlbumName         = song1.AlbumName;
                    aSong.YearReleased      = song1.YearReleased;
                    aSong.DurationInSeconds = song1.DurationInSeconds;
                    aSong.TrackNumber       = song1.TrackNumber;
                    aSong.TrackCount        = song1.TrackCount;
                    aSong.Genre             = song1.Genre;
                    aSong.MyRating          = song1.MyRating;

                    aSong = this.listBox1.SelectedItem as Song;
                    _MediaCollection.MediaList.Add(aSong);
                    _MediaCollection.MediaList.Remove(aSong);
                }
            }
            else
            {
                MessageBox.Show("There are no seongs to edit...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#6
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedItem != null)
            {
                Song aSong = listBox1.SelectedItem as Song;
                FormSong Songs = new FormSong(aSong);

                Song song1 = new Song();
                song1.SongName = aSong.SongName;
                song1.ArtistName = aSong.ArtistName;
                song1.AlbumName = aSong.AlbumName;
                song1.YearReleased = aSong.YearReleased;
                song1.DurationInSeconds = aSong.DurationInSeconds;
                song1.TrackNumber = aSong.TrackNumber;
                song1.TrackCount = aSong.TrackCount;
                song1.Genre = aSong.Genre;
                song1.MyRating = aSong.MyRating;

                if (Songs.ShowDialog() == DialogResult.OK)
                {
                    //ListBox Refresh
                    _MediaCollection.MediaList.Add(aSong);
                    _MediaCollection.MediaList.Remove(aSong);
                }
                else
                {
                    aSong.SongName = song1.SongName;
                    aSong.ArtistName = song1.ArtistName;
                    aSong.AlbumName = song1.AlbumName;
                    aSong.YearReleased = song1.YearReleased;
                    aSong.DurationInSeconds = song1.DurationInSeconds;
                    aSong.TrackNumber = song1.TrackNumber;
                    aSong.TrackCount = song1.TrackCount;
                    aSong.Genre = song1.Genre;
                    aSong.MyRating = song1.MyRating;

                    aSong = this.listBox1.SelectedItem as Song;
                    _MediaCollection.MediaList.Add(aSong);
                    _MediaCollection.MediaList.Remove(aSong);
                }
            }
            else
                MessageBox.Show("There are no seongs to edit...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }