示例#1
0
        private void EditBtn_Click(object sender, EventArgs e)
        {
            try
            {
                PLForm Form;
                Form = new PLForm(PLlistBox.SelectedItem.ToString(), "EDIT");
                Form.ShowDialog();
                PLlistBox.Items.Remove(PLlistBox.SelectedItem);

                if (MyPlaylists.getPlaylistNames() != null)
                {
                    foreach (String filename in MyPlaylists.getPlaylistNames())
                    {
                        Boolean flag = false;
                        foreach (String listitem in PLlistBox.Items)
                        {
                            if (filename.Equals(listitem))
                            {
                                flag = true;
                            }
                        }
                        if (!flag)
                        {
                            PLlistBox.Items.Add(filename);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Cannot edit the playlist!\n\n" + ex);
            }
        }
示例#2
0
        private void SaveBtn_Click(object sender, EventArgs e)
        {
            PLForm Form;

            Form = new PLForm(null, "SAVE");
            Form.ShowDialog();
            if (MyPlaylists.getPlaylistNames() != null)
            {
                foreach (String filename in MyPlaylists.getPlaylistNames())
                {
                    Boolean flag = false;
                    foreach (String listitem in PLlistBox.Items)
                    {
                        if (filename.Equals(listitem))
                        {
                            flag = true;
                        }
                    }
                    if (!flag)
                    {
                        PLlistBox.Items.Add(filename);
                    }
                }
            }
        }
示例#3
0
        private void AddPLbtn_Click(object sender, EventArgs e)
        {
            PLForm FormPL = new PLForm(null, "ADD");

            FormPL.ShowDialog();

            if (MyPlaylists.getPlaylistNames() != null)
            {
                foreach (String filename in MyPlaylists.getPlaylistNames())
                {
                    Boolean flag = false;
                    foreach (String listitem in PLlistBox.Items)
                    {
                        if (filename.Equals(listitem))
                        {
                            flag = true;
                        }
                    }
                    if (!flag)
                    {
                        PLlistBox.Items.Add(filename);
                    }
                }
            }
            tabControl1.SelectedTab = tabPage2;
        }