本文整理汇总了C#中IPlugin.Down方法的典型用法代码示例。如果您正苦于以下问题:C# IPlugin.Down方法的具体用法?C# IPlugin.Down怎么用?C# IPlugin.Down使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPlugin
的用法示例。
在下文中一共展示了IPlugin.Down方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParallelDownLoad
private void ParallelDownLoad(Dictionary<int, string> container, string info, IPlugin lrcDown)
{
toolStripStatusLabel_Information.Text = info;
toolStripProgressBar_DownLoad.Value = 0;
toolStripProgressBar_DownLoad.Maximum = container.Count;
Parallel.ForEach(container, new ParallelOptions() { MaxDegreeOfParallelism = Config.configValue.option_ThreadNumber }, (item) =>
{
try
{
FileWrite fs = new FileWrite();
byte[] lrcData = null;
if (Config.configValue.option_IgnoreFile && checkMusicExits(item.Value))
{
listView_Music.Items[item.Key].SubItems[1].Text = "略过";
}
else
{
// 下载歌词
if (lrcDown.Down(item.Value, ref lrcData, Config.configValue.option_ThreadNumber) == true)
{
listView_Music.Items[item.Key].SubItems[1].Text = "成功";
if (fs.Write(ref lrcData, item.Value, Config.configValue.option_Encoding, Config.configValue.option_UserDirectory))
{
lock (LongLife.MusicPathFailedList) LongLife.MusicPathFailedList.Remove(item.Key);
}
else
{
listView_Music.Items[item.Key].SubItems[1].Text = "失败";
}
}
else
{
listView_Music.Items[item.Key].SubItems[1].Text = "失败";
lock (LongLife.MusicPathFailedList)
{
if (!LongLife.MusicPathFailedList.ContainsKey(item.Key))
{
LongLife.MusicPathFailedList.Add(item.Key, item.Value);
}
}
}
}
}
catch (Exception exp)
{
Console.WriteLine(exp.ToString());
}
toolStripProgressBar_DownLoad.Value++;
});
}