Esempio n. 1
0
        /// <summary>
        /// Добавляем плейлист
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            var check = (Main_Form.Settings.playLists.Where(x => x.Name == textBox1.Text)).Count() > 0 ? false : true;

            if (check)
            {
                var checkedV = checkedListBox1.CheckedItems.Cast <string>().ToList();
                if (checkedV.Count != 0)
                {
                    Main_Form.Settings.playLists.Add(new Main_Form.PlayList()
                    {
                        Name      = textBox1.Text,
                        songsList = checkedV,
                    });
                    Main_Form.updatePlayLists();
                    this.Dispose();
                }
                else
                {
                    MessageBox.Show("Не выбран ни один трек!", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show("Такой плейлист уже существет!", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Удаляем плейлист
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void button2_Click(object sender, EventArgs e)
 {
     Main_Form.Settings.selectedIndex = Main_Form.Settings.selectedIndex == 0 ? 0 : Main_Form.Settings.selectedIndex - 1;
     Main_Form.Settings.playLists.Remove(Main_Form.Settings.playLists.Where(x => x.Name == _playListName).FirstOrDefault());
     Main_Form.updatePlayLists();
     this.Dispose();
 }
Esempio n. 3
0
        /// <summary>
        /// Изменяем плейлист
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            var playList = Main_Form.Settings.playLists.Where(x => x.Name == _playListName).FirstOrDefault();

            playList.songsList.Clear();
            playList.songsList.AddRange(checkedListBox1.CheckedItems.Cast <string>());
            Main_Form.updatePlayLists();
            this.Dispose();
        }