public static string GetSongUri(Song s,string token) { XmlDocument xd = new XmlDocument(); xd.Load("https://api.vkontakte.ru/method/audio.search.xml?q="+s.SongName+"-"+s.GroupName+"&count=1&access_token="+token); XmlElement xe = xd.DocumentElement; XmlNodeList xnl = xe.GetElementsByTagName("url"); //s.Source = xnl[0].InnerXml; return xnl[0].InnerXml; }
/* public Playlist(int n) { for (int i = 0; i < this.pl.Count; ++i) { this } } */ public void AddSong(Song s) { pl.Add(s); }
private void button3_Click(object sender, RoutedEventArgs e) { System.Windows.Forms.OpenFileDialog ofd= new System.Windows.Forms.OpenFileDialog(); ofd.Filter = "Video Files|*.avi;*.mpeg;*.wmv|" + "Music Files|*.mp3;*.wma|" + "All Files|*.*"; if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { //listBox1.Items.Add(ofd.FileName); //mediaElement1.Source = new Uri(ofd.FileName); Song s = new Song("Karma Police", "2", ofd.FileName); myPl.AddSong(s); } }