public static void Main(string[] args) { try { var playlistGeneratorSettings = new PlaylistGeneratorSettings(); Parser.Default.ParseArguments(args, playlistGeneratorSettings); var playlistGenerator = new PlaylistGenerator(playlistGeneratorSettings); using (var streamWriter = new StreamWriter(playlistGeneratorSettings.OutputFilePath)) { playlistGenerator.Generate(streamWriter.Write); } } catch (PlaylistGeneratorException e) { Console.WriteLine(e.Message); } }
private void onGeneratePlaylist(object sender, MouseEventArgs e) { string rootpath = MP3Path.Text; if (rootpath.Length == 0) { MessageBox.Show("Select Folder first.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } string rootname = rootpath.Substring(rootpath.LastIndexOf("\\") + 1); List <Playlist> pll = new List <Playlist>(); GeneratePlaylist(rootpath, rootpath, rootname, ref pll); if (PlaylistGenerator.Generate(rootpath, pll, overwritePlayList.Checked)) { MessageBox.Show("Playlists generated", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Error occured while generating Playlists", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); } }