Exemplo n.º 1
0
        private void addUrlBTN_Click(object sender, EventArgs e)
        {
            AddURLForm   inputForm = new AddURLForm();
            DialogResult dlg       = inputForm.ShowDialog();

            if (dlg == DialogResult.OK)
            {
                ParseAddURL(inputForm);
            }
            inputForm.Dispose();
        }
Exemplo n.º 2
0
        private void ParseAddURL(AddURLForm inputForm)
        {
            string link = inputForm.textBox1.Text;
            Regex  rx   = new Regex(@"(?:youtu\.be\/|v=)([^&]+)");
            Match  m    = rx.Match(link);

            if (m.Success)
            {
                DataManager.AddURLToTrack(selectedArtist, selectedAlbum, selectedTrack, m.Groups[1].Value);
                dgv_CellContentClick(null, null);
            }
            else
            {
                MessageBox.Show("Invalid youtube link provided");
            }
        }