Exemplo n.º 1
0
        private void ButtonSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (TextBoxTitle.Tag.ToString() == "Ok")
                {
                    TagFile.SetTitle(MainForm.Music[CurrentPlayingMusicIndex], TextBoxTitle.Text);
                    TextBoxTitle.Tag = "";
                }

                if (TextBoxArtists.Tag.ToString() == "Ok")
                {
                    TagFile.SetArtists(MainForm.Music[CurrentPlayingMusicIndex], TextBoxArtists.Text);
                    TextBoxArtists.Tag = "";
                }

                try
                {
                    if (TextBoxAlbum.Tag.ToString() == "Ok")
                    {
                        TagFile.SetAlbum(MainForm.Music[CurrentPlayingMusicIndex], TextBoxAlbum.Text);
                        TextBoxAlbum.Tag = "";
                    }
                }
                catch (NullReferenceException)
                {
                    //  Add Code later
                }
                catch (Exception Exc)
                {
                    MessageBox.Show(Exc.ToString(), "====:TextBoxAlbum:====");
                    MessageBox.Show(Exc.GetType().ToString(), "====:TextBoxAlbum:====");
                }

                if (TextBoxTrack.Tag.ToString() == "Ok")
                {
                    TagFile.SetTrackN(MainForm.Music[CurrentPlayingMusicIndex], TextBoxTrack.Text);
                    TextBoxTrack.Tag = "";
                }

                if (TextBoxTrackCount.Tag.ToString() == "Ok")
                {
                    TagFile.SetTrackCount(MainForm.Music[CurrentPlayingMusicIndex], TextBoxTrackCount.Text);
                    TextBoxTrackCount.Tag = "";
                }

                if (TextBoxYear.Tag.ToString() == "Ok")
                {
                    TagFile.SetYear(MainForm.Music[CurrentPlayingMusicIndex], TextBoxYear.Text);
                    TextBoxYear.Tag = "";
                }

                if (TextBoxGenre.Tag.ToString() == "Ok")
                {
                    TagFile.SetGenre(MainForm.Music[CurrentPlayingMusicIndex], TextBoxGenre.Text);
                    TextBoxGenre.Tag = "";
                }

                try
                {
                    if (PictureBoxCover.Tag.ToString() == "Ok")
                    {
                        TagFile.SetCover(MainForm.Music[CurrentPlayingMusicIndex], PictureBoxCover.Image);
                        PictureBoxCover.Tag = "";
                    }
                }
                catch (NullReferenceException)
                {
                    //  Add Code later
                }
                catch (Exception Exc)
                {
                    MessageBox.Show(Exc.ToString(), "====:PictureBoxCover:====");
                    MessageBox.Show(Exc.GetType().ToString(), "====:PictureBoxCover:====");
                }

                TagFile.SetLyrics(MainForm.Music[CurrentPlayingMusicIndex], RichTextBoxLyrics.Text);

                MessageBox.Show("All Tags Saved");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "====:Save:====");
                MessageBox.Show(ex.GetType().ToString(), "====:Save:====");
            }
        }