ToastNotifier.RemoveFromSchedule(ScheduledToastNotification) 方法

定义

取消指定 ScheduledToastNotification 的计划显示。

重要

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

public:
 virtual void RemoveFromSchedule(ScheduledToastNotification ^ scheduledToast) = RemoveFromSchedule;
void RemoveFromSchedule(ScheduledToastNotification const& scheduledToast);
public void RemoveFromSchedule(ScheduledToastNotification scheduledToast);
function removeFromSchedule(scheduledToast)
Public Sub RemoveFromSchedule (scheduledToast As ScheduledToastNotification)

参数

scheduledToast
ScheduledToastNotification

要从计划中删除的通知。

示例

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

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]);
    }
}

注解

如果要取消一个或多个计划的 Toast 通知,可以使用 GetScheduledToastNotifications 方法获取完整列表。

适用于