JumpList.JumpItemsRejected JumpList.JumpItemsRejected JumpList.JumpItemsRejected JumpList.JumpItemsRejected Event

定义

在 Windows shell 将跳转项添加到跳转列表中失败时发生。Occurs when jump items are not successfully added to the Jump List by the 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 Event JumpItemsRejected As EventHandler(Of JumpItemsRejectedEventArgs) 

示例

下面的示例演示如何处理JumpItemsRejected事件,以便在消息框中显示拒绝的项。The following example shows how to handle the JumpItemsRejected event to display the rejected items in a message box. 此示例是JumpList类概述中提供的一个更大示例的一部分。This example is part of a larger example available in the JumpList class overview.

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

注解

将的内容JumpList应用到 windows shell 之后,该JumpItems属性将被修改为仅包含 Windows shell 成功添加到其跳转列表中的那些项。After the contents of the JumpList are applied to the Windows shell, the JumpItems property is modified to contain only those items that the Windows shell successfully added to its Jump List. 可以通过JumpItemsRejectedJumpItemsRemovedByUser事件的事件处理程序访问已删除项的列表。You can access the lists of removed items through event handlers for the JumpItemsRejected and JumpItemsRemovedByUser events.

适用于