Exemplo n.º 1
0
        public SongProperties DecodeFileName(string filename)
        {
            foreach (string voicePart in _voiceParts)
            {
                int indexOfPart = filename.IndexOf(voicePart, StringComparison.OrdinalIgnoreCase);
                if (indexOfPart > -1)
                {
                    var title = ExtractTitle(filename, indexOfPart);

                    var songPart = ExtractSongPart(filename, indexOfPart, voicePart);

                    int year = ExtractSongYear(filename);

                    var props = new SongProperties
                        {
                            Part = songPart,
                            Title = title,
                            Year = year,
                            AlbumTitle = AlbumTitle,
                            Artist = ArtistName
                        };
                    return props;
                }

            }

            var colour = Console.ForegroundColor;
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine(filename);
            Console.ForegroundColor = colour;

            return new SongProperties {Title = filename, Part = ""};
        }
Exemplo n.º 2
0
 public TitleFormatter(SongProperties properties)
 {
     _properties = properties;
 }