public IPlaylistItems Create(string filepath) { IPlaylistItems playlistItems = null; if (string.IsNullOrEmpty(filepath)) { return(null); } var extension = Path.GetExtension(filepath); switch (extension) { case ".mp3": playlistItems = new Mp3Item(filepath); break; //case ".jpg": // playlistItems = new PictureItem(filepath); // cuando no es conocido el formato va a el default // break; default: playlistItems = null; break; } return(playlistItems); }
public IPlaylistItem Create(string filePath) { IPlaylistItem playlistItem = null; if (string.IsNullOrWhiteSpace(filePath)) { return(playlistItem); } var extension = Path.GetExtension(filePath); switch (extension) { case ".mp3": playlistItem = new Mp3Item(filePath); break; default: playlistItem = null; break; } return(playlistItem); }