ToastNotifier.GetScheduledToastNotifications 方法

定义

获取此应用已计划显示的 ScheduledToastNotification 对象的集合。

重要

此方法仅在使用 WinRT 作为其默认应用程序框架的应用程序中受支持。

public:
 virtual IVectorView<ScheduledToastNotification ^> ^ GetScheduledToastNotifications() = GetScheduledToastNotifications;
IVectorView<ScheduledToastNotification> GetScheduledToastNotifications();
public IReadOnlyList<ScheduledToastNotification> GetScheduledToastNotifications();
function getScheduledToastNotifications()
Public Function GetScheduledToastNotifications () As IReadOnlyList(Of ScheduledToastNotification)

返回

绑定到此通知器的应用已计划定时显示的计划 Toast 通知的集合。

示例

以下示例演示如何使用 GetScheduledToastNotifications 方法。

var notifier = Notifications.ToastNotificationManager.createToastNotifier();
var scheduled = notifier.getScheduledToastNotifications();                    

for (var i = 0, len = scheduled.length; i < len; i++) {

    // The itemId value is the unique ScheduledTileNotification.Id assigned to the 
    // notification when it was created.
    if (scheduled[i].id === itemId) {
        notifier.removeFromSchedule(scheduled[i]);
    }
}

适用于