Table of Contents

INotificationHostService 接口

命名空间
ClassIsland.Core.Abstractions.Services
程序集
ClassIsland.Core.dll

提醒主机服务,用于管理提醒提供方和发布提醒。

public interface INotificationHostService : IHostedService, INotifyPropertyChanged
继承成员

方法

GetNotificationProviderSettings<T>(Guid)

获取提醒服务设置实例。如果此提醒提供方设置不存在,则会新建并保存一个实例指定的设置实例。

T GetNotificationProviderSettings<T>(Guid id) where T : class

参数

id Guid

提醒服务id

返回

T

对应提醒服务设置实例。若不存在,则返回默认值。

类型参数

T

提醒提供方设置类型

RegisterNotificationProvider(INotificationProvider)

注册提醒服务。

void RegisterNotificationProvider(INotificationProvider provider)

参数

provider INotificationProvider

要注册的服务实例。

示例

NotificationHostService.RegisterNotificationProvider(this);

ShowNotification(NotificationRequest)

显示提醒。

void ShowNotification(NotificationRequest request)

参数

request NotificationRequest

提醒请求

备注

注意:此方法必须由提醒主机调用。

ShowNotificationAsync(NotificationRequest)

显示提醒,并等待提醒显示完成。

Task ShowNotificationAsync(NotificationRequest request)

参数

request NotificationRequest

提醒请求

返回

Task

备注

注意:此方法必须由提醒主机调用。

WriteNotificationProviderSettings<T>(Guid, T)

保存提醒提供方设置。

void WriteNotificationProviderSettings<T>(Guid id, T settings)

参数

id Guid

提醒提供方 ID

settings T

要保存的设置

类型参数

T

提醒提供方设置类型