Chimney.MPD.Classes.SongTag.GetSongTagFromFile C# (CSharp) Метод

GetSongTagFromFile() публичный статический Метод

public static GetSongTagFromFile ( StorageFile storageFile ) : Task
storageFile Windows.Storage.StorageFile
Результат Task
        public static async Task<SongTag> GetSongTagFromFile(StorageFile storageFile)
        {
            SongTag songTag = new SongTag();
            Windows.Storage.FileProperties.MusicProperties mp = await storageFile.Properties.GetMusicPropertiesAsync();
            //songTag.file = seekpath.Item2 + "/" + file.Name;
            songTag.Title = mp.Title;
            songTag.Artist = mp.Artist;
            songTag.Album = mp.Album;
            songTag.AlbumArtist = mp.AlbumArtist;
            songTag.Date = mp.Year.ToString();
            songTag.Time = Convert.ToInt32(mp.Duration.TotalSeconds);
            if (mp.Genre.Count > 0) songTag.Genre = mp.Genre.First<string>();

            return songTag;
        }
    }