Export (0) Print
Expand All

JumpList.JumpItemsRejected Event

Occurs when jump items are not successfully added to the Jump List by the Windows shell.

Namespace:  System.Windows.Shell
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: Not mapped to an xmlns.

public event EventHandler<JumpItemsRejectedEventArgs> JumpItemsRejected
<object JumpItemsRejected="EventHandler<JumpItemsRejectedEventArgs>" .../>

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. You can access the lists of removed items through event handlers for the JumpItemsRejected and JumpItemsRemovedByUser events.

The following example shows how to handle the JumpItemsRejected event to display the rejected items in a message box. 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());
}

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft