private void ProcessCmdLine() { if (args.Length < 2) { return; } if (new System.IO.FileInfo(args[1]).Extension == ".xspf") { List <PlaylistItem> loaded = XSPF.Load(args[1]); if (loaded.Count != 0) { foreach (PlaylistItem p in loaded) { AddToPlaylist(p); } } } else { for (int i = 1; i < args.Length; i++) //skip the first argument, it's just the exe { AddToPlaylist(XSPF.GetTags(args[i])); } } Play(); }
private void openPlaylistToolStripMenuItem_Click(object sender, EventArgs e) { if (openPlaylistDialog.ShowDialog() != DialogResult.OK) { return; } List <PlaylistItem> loaded = XSPF.Load(openPlaylistDialog.FileName); if (loaded.Count == 0) { return; } list.Clear(); lstPlaylist.Items.Clear(); foreach (PlaylistItem p in loaded) { AddToPlaylist(p); } }