コード例 #1
0
        private void btn_Ok_Click(object sender, EventArgs e)
        {
            bool check = true;

            if (tb_Name.Text == "")
            {
                MessageBox.Show("Enter a playlist's name", "Notify");
            }
            else
            {
                foreach (PlayListInfoVideo item in PlaylistVideo.Instance.GetAllPlayListVideo())
                {
                    if (tb_Name.Text == item.Name_PL)
                    {
                        check = false;
                        MessageBox.Show("This name is already.", "Error");
                    }
                }
                if (check == true)
                {
                    PlaylistVideo.Instance.AddItems(new PlayListInfoVideo(DateTime.Now, tb_Name.Text, listVideo));
                    form_Music_Playlist NewForm = new form_Music_Playlist(new Music_Playlist(Playlist.Instance.GetAllPlayListMusic().Count - 1, this.tb_Name.Text, 0, this.parent));
                    this.parent.openChildForm(NewForm);
                    Playlist.Instance.Export();
                    Playlist.Instance.GetListMusic(Playlist.Instance.GetAllPlayListMusic().Count - 1).Export();
                    Close();
                }
            }
        }
コード例 #2
0
 public form_Rename_pl(form_Music_Playlist parent = null)
 {
     this.parent = parent;
     InitializeComponent();
 }