Exemple #1
0
        private void addSongButton_Click(object i_Sender, EventArgs i_EventArgs)
        {
            Song   curSong   = null;
            string curPlayer = null;

            if (!string.IsNullOrEmpty(NewSongNameTextBox.Text))
            {
                if (YoutubeRadioButton.Checked)
                {
                    curPlayer = "youtube";
                }
                else
                {
                    curPlayer = "vimeo";
                }

                curSong = SongsFactory.CreateSong(curPlayer, NewSongNameTextBox.Text);
                string   videoUrl = curSong.GetVideoUrl(NewSongNameTextBox.Text);
                TreeNode songNode = PlaylistTreeView.Nodes[1].Nodes.Add(curSong.SongName); // Nodes[1]=User Playlist

                songNode.Tag = curSong;
                MessageBox.Show(string.Format("The song: \"{0}\" added to your playlist!", NewSongNameTextBox.Text));
                NewSongNameTextBox.Text = string.Empty;
            }
            else
            {
                MessageBox.Show("You didn't insert song name!");
            }
        }
        protected override void OnShown(EventArgs i_EventArgs)
        {
            foreach (Link curLink in m_UserLinks)
            {
                try
                {
                    Song     song     = SongsFactory.CreateSong(curLink.URL, curLink.Name);
                    TreeNode songNode = PlaylistTreeView.Nodes[0].Nodes.Add(song.SongName); // Nodes[0]=Facebook Posts

                    songNode.Tag = song;                                                    // save the song under song's name
                }
                catch (Exception ex)
                {
                }
            }
        }
Exemple #3
0
        private void fetchUserLinkes()
        {
            foreach (Link curLink in m_UserLinks)
            {
                try
                {
                    Song song = SongsFactory.CreateSong(curLink.URL, curLink.Name);

                    if (!PlaylistTreeView.InvokeRequired)
                    {
                        addSongToTreeView(song);
                    }
                    else
                    {
                        PlaylistTreeView.Invoke(new Action(() => addSongToTreeView(song))); // save the song under song's name));
                    }
                }
                catch (Exception)
                {
                }
            }
        }