Files
SteamTools/System.Application.SteamTools.Client/ImageChannelType.cs
T
2021-03-03 23:57:59 +08:00

40 lines
1.0 KiB
C#

using System.Application;
using System.Application.Services;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace System.Application
{
/// <summary>
/// 图片下载渠道类型
/// </summary>
public enum ImageChannelType
{
/// <summary>
/// Steam 头像图片
/// </summary>
SteamAvatars,
/// <summary>
/// Steam 游戏图片
/// </summary>
SteamGames,
}
}
namespace System
{
public static class ImageChannelTypeEnumExtensions
{
/// <inheritdoc cref="IHttpService.GetImageAsync(string, string, CancellationToken)"/>
public static Task<Stream?> GetImageAsync(this IHttpService httpService,
string requestUri,
ImageChannelType channelType,
CancellationToken cancellationToken = default)
{
var channelType_ = channelType.ToString();
return httpService.GetImageAsync(requestUri, channelType_, cancellationToken);
}
}
}