共用方式為


JumpList.JumpItemsRejected 事件

定義

發生於無法由 Windows Shell 將跳躍項目加入至跳躍清單時。

public:
 event EventHandler<System::Windows::Shell::JumpItemsRejectedEventArgs ^> ^ JumpItemsRejected;
public event EventHandler<System.Windows.Shell.JumpItemsRejectedEventArgs> JumpItemsRejected;
member this.JumpItemsRejected : EventHandler<System.Windows.Shell.JumpItemsRejectedEventArgs> 
Public Custom Event JumpItemsRejected As EventHandler(Of JumpItemsRejectedEventArgs) 
Public Event JumpItemsRejected As EventHandler(Of JumpItemsRejectedEventArgs) 

事件類型

範例

下列範例示範如何處理 事件, JumpItemsRejected 以在訊息方塊中顯示拒絕的專案。 此範例是類別概觀中較大範例的 JumpList 一部分。

private void JumpList_JumpItemsRejected(object sender, System.Windows.Shell.JumpItemsRejectedEventArgs e)
{
    StringBuilder sb = new StringBuilder();
    sb.AppendFormat("{0} Jump Items Rejected:\n", e.RejectionReasons.Count);
    for (int i = 0; i < e.RejectionReasons.Count; ++i)
    {
        if (e.RejectedItems[i].GetType() == typeof(JumpPath))
            sb.AppendFormat("Reason: {0}\tItem: {1}\n", e.RejectionReasons[i], ((JumpPath)e.RejectedItems[i]).Path);
        else
            sb.AppendFormat("Reason: {0}\tItem: {1}\n", e.RejectionReasons[i], ((JumpTask)e.RejectedItems[i]).ApplicationPath);
    }

    MessageBox.Show(sb.ToString());
}

備註

套用至 Windows 殼層的內容 JumpList 之後, JumpItems 屬性會修改為只包含 Windows 殼層成功新增至其跳躍清單的專案。 您可以透過 和 JumpItemsRemovedByUser 事件的事件處理常式 JumpItemsRejected 來存取已移除的專案清單。

適用於