修改工单流程页面,订单列表增加工单按钮
This commit is contained in:
1 parent
f9dcae4610
commit
10bb0803d9
44 files changed
+5920
-1291
No files matched your search
@@ -0,0 +1,35 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace OrderSupportTicket.Services;
|
||||
|
||||
/// <summary>
|
||||
/// 商品缩略图加载器,限制并发下载数量,避免工单列表同时发起大量请求。
|
||||
/// </summary>
|
||||
internal static class ProductImageLoader
|
||||
{
|
||||
private static readonly SemaphoreSlim Gate = new SemaphoreSlim(4, 4);
|
||||
|
||||
public static async Task<ImageSource> LoadAsync(string url)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(url))
|
||||
return null;
|
||||
|
||||
await Gate.WaitAsync().ConfigureAwait(false);
|
||||
try
|
||||
{
|
||||
return await Task.Run(
|
||||
() => AllBase.ImageBuild.LoadBitmipImageFromUrl(url.Trim()))
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Gate.Release();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user