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

備註

如果您想要取消一或多個排程的快顯通知,您可以使用 GetScheduledToastNotifications 方法來取得完整清單。

適用於