Files
SteamTools/System.Common.ClientLib/Application/Services/INotificationService.cs
T
2021-02-20 16:45:44 +08:00

49 lines
1.4 KiB
C#

namespace System.Application.Services
{
/// <summary>
/// 通知栏服务
/// </summary>
/// <typeparam name="TNotificationType"></typeparam>
public interface INotificationService<TNotificationType> where TNotificationType : Enum
{
/// <summary>
/// 获取是否有通知权限
/// </summary>
/// <returns></returns>
bool AreNotificationsEnabled();
/// <summary>
/// 显示通知
/// </summary>
/// <param name="text">通知内容</param>
/// <param name="notificationType">通知类型</param>
/// <param name="autoCancel"></param>
/// <param name="title">通知标题</param>
/// <param name="entrance"></param>
void Notify(
string text,
TNotificationType notificationType,
bool autoCancel = true,
string? title = default,
Type? entrance = default);
/// <summary>
/// 取消通知
/// </summary>
/// <param name="notificationType"></param>
void Cancel(TNotificationType notificationType);
/// <summary>
/// 取消所有通知
/// </summary>
void CancelAll();
/// <summary>
/// 下载进度通知
/// </summary>
Progress<float> NotifyDownload(
string text,
TNotificationType notificationType,
string? title = default);
}
}