Table of Contents

INotificationHostService 接口

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

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

public interface INotificationHostService : IHostedService, INotifyPropertyChanged
继承成员

属性

IsNotificationsPlaying

当前是否正在播放提醒

bool IsNotificationsPlaying { get; }

属性值

bool

方法

GetNotificationProviderSettings<T>(Guid)

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

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

参数

id Guid

提醒服务id

返回

T

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

类型参数

T

提醒提供方设置类型

PullNotificationRequests()

拉取要播放的提醒。

IList<NotificationRequest> PullNotificationRequests()

返回

IList<NotificationRequest>

获得的提醒

备注

此方法一般情况下只会返回一个要显示的提醒。如果有成链的提醒,会将这些提醒一并返回。请在显示完上次显示的提醒后再调用此方法。

RegisterNotificationConsumer(INotificationConsumer, int)

注册提醒消费者。

void RegisterNotificationConsumer(INotificationConsumer consumer, int priority)

参数

consumer INotificationConsumer

要注册的提醒消费者

priority int

提醒消费者优先级

RegisterNotificationProvider(INotificationProvider)

注册提醒服务。

void RegisterNotificationProvider(INotificationProvider provider)

参数

provider INotificationProvider

要注册的服务实例。

示例

NotificationHostService.RegisterNotificationProvider(this);

UnregisterNotificationConsumer(INotificationConsumer)

取消注册提醒消费者。

void UnregisterNotificationConsumer(INotificationConsumer consumer)

参数

consumer INotificationConsumer

要注销的提醒消费者

WriteNotificationProviderSettings<T>(Guid, T)

保存提醒提供方设置。

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

参数

id Guid

提醒提供方 ID

settings T

要保存的设置

类型参数

T

提醒提供方设置类型