本文整理汇总了C#中Song.initial方法的典型用法代码示例。如果您正苦于以下问题:C# Song.initial方法的具体用法?C# Song.initial怎么用?C# Song.initial使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Song
的用法示例。
在下文中一共展示了Song.initial方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSongs
private async Task<int> GetSongs(string tempPath, double percent, int total)
{
StorageFolder tempFolder = await StorageApplicationPermissions.FutureAccessList.GetFolderAsync(tempPath);
IReadOnlyList<IStorageFile> AllList = await SearchAllinFolder(tempFolder);
int count = AllList.Count;
int index = albumList.Count;
int progress = 0;
if (count == 0)
{
OnProgressChanged(1 / total, percent);
return 0;
}
foreach (StorageFile tempFile in AllList)
{
if (tempTypeStrings.Contains(tempFile.FileType))
{
Song song = new Song(tempFile, tempPath);
await song.initial();
await AddtoAlbum_first(song);
}
progress++;
OnProgressChanged((double)progress / ((double)count * total), percent);
}
foreach (AlbumItem item in albumList)
{
await item.Refresh();
}
List<AlbumItem> afterList = albumList.ToList();
afterList.RemoveRange(0, index);
#pragma warning disable CS4014 // 由于此调用不会等待,因此在调用完成前将继续执行当前方法
Task.Run(() =>
{
saveAlbumstoStorage(afterList, tempPath);
});
#pragma warning restore CS4014 // 由于此调用不会等待,因此在调用完成前将继续执行当前方法
return count;
}
示例2: RefreshtoList
public async Task RefreshtoList(KeyValuePair<string, List<IStorageFile>> item)
{
if (Refreshing == true && NowRefreshKeys.Contains(item.Key))
return;
Refreshing = true;
NowRefreshKeys.Add(item.Key);
int index = albums.Count;
string tempPath = item.Key;
foreach (IStorageFile tempFile in item.Value)
{
if (tempTypeStrings.Contains(tempFile.FileType))
{
Song song = new Song((StorageFile)tempFile, tempPath);
await song.initial();
await AddtoAlbum_first(song);
}
}
foreach (AlbumItem album in albumList)
{
await album.Refresh();
}
List<AlbumItem> afterList = albumList.ToList();
afterList.RemoveRange(0, index);
albums.AddRange(afterList);
this.OnNotifyRefresh("finish");
ThreadPool.RunAsync((work) =>
{
RefreshAlbumstoStorage(afterList, tempPath);
});
NowRefreshKeys.Remove(item.Key);
}