本文整理汇总了C#中Album.Browse方法的典型用法代码示例。如果您正苦于以下问题:C# Album.Browse方法的具体用法?C# Album.Browse怎么用?C# Album.Browse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Album
的用法示例。
在下文中一共展示了Album.Browse方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlayAlbum
/// <summary>
/// Adds an album to the beginning of the play queue
/// </summary>
/// <param name="album">The album to add</param>
/// <returns>The first track to play</returns>
public async Task<Track> PlayAlbum(Album album)
{
AlbumBrowse b = await album.Browse();
IList<Track> t = b.Tracks;
tracks.InsertRange(0, t);
return Dequeue();
}
示例2: ListAlbumTracks
private async Task ListAlbumTracks(Album album, IResponse<TextMessage> msg)
{
var browse = await album.Browse();
var sb = new StringBuilder();
sb.AppendFormat("Artist - {0}\r\n", album.Artist.Name);
sb.AppendFormat("Album - {0}\r\n", album.Name);
foreach (var track in browse.Tracks)
{
sb.AppendFormat("#{0}: {1}\r\n", track.Index, track.Name);
}
await msg.Send(sb.ToString());
}
示例3: PlayAlbum
public async Task<string> PlayAlbum(Album album)
{
AlbumBrowse albumBrowse = await album.Browse();
await Play(albumBrowse.Tracks[0]);
await PrependToQueue(albumBrowse.Tracks.Skip(1));
await SaveQueue();
return string.Format("Queued up {0} tracks from album {1} by {2}",
albumBrowse.Tracks.Count, albumBrowse.Album.Name, albumBrowse.Artist.Name);
}
示例4: QueueUpAlbum
public async Task<string> QueueUpAlbum(Album album)
{
AlbumBrowse albumBrowse = await album.Browse();
albumBrowse.Tracks.ForEach(t => AddToQueue(t));
await SaveQueue();
return string.Format("Queued up {0} tracks from album {1} by {2}",
albumBrowse.Tracks.Count, albumBrowse.Album.Name, albumBrowse.Artist.Name);
}
示例5: AddAlbum
/// <summary>
/// Adds an album to the end of the play queue
/// </summary>
/// <param name="album">The album to add</param>
/// <returns>A task</returns>
public async Task AddAlbum(Album album)
{
AlbumBrowse b = await album.Browse();
IList<Track> t = b.Tracks;
tracks.AddRange(t);
}