JumpList.GetJumpList(Application) Méthode

Définition

Retourne l'objet JumpList associé à une application.

public:
 static System::Windows::Shell::JumpList ^ GetJumpList(System::Windows::Application ^ application);
public static System.Windows.Shell.JumpList GetJumpList (System.Windows.Application application);
static member GetJumpList : System.Windows.Application -> System.Windows.Shell.JumpList
Public Shared Function GetJumpList (application As Application) As JumpList

Paramètres

application
Application

Application associée à JumpList.

Retours

Objet JumpList associé à l'application spécifiée.

Exemples

L’exemple suivant montre comment obtenir le JumpList associé à l’application actuelle. A JumpTask est ajouté à la JumpItems collection et ajouté à la catégorie Récent . La Apply méthode est appelée pour appliquer le mis à jour JumpList à l’interpréteur de commandes Windows. Cet exemple fait partie d’un exemple plus large disponible dans la vue d’ensemble de la JumpList classe.

private void AddTask(object sender, RoutedEventArgs e)
{
    // Configure a new JumpTask.
    JumpTask jumpTask1 = new JumpTask();
    // Get the path to Calculator and set the JumpTask properties.
    jumpTask1.ApplicationPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.SystemX86), "calc.exe");
    jumpTask1.IconResourcePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.SystemX86), "calc.exe");
    jumpTask1.Title = "Calculator";
    jumpTask1.Description = "Open Calculator.";
    jumpTask1.CustomCategory = "User Added Tasks";
    // Get the JumpList from the application and update it.
    JumpList jumpList1 = JumpList.GetJumpList(App.Current);
    jumpList1.JumpItems.Add(jumpTask1);
    JumpList.AddToRecentCategory(jumpTask1);
    jumpList1.Apply();
}

Remarques

Vous pouvez appeler la GetJumpList méthode pour obtenir le JumpList actuellement associé à un Application. Le .NET Framework n’exige pas que ce soit le JumpList qui est actuellement appliqué à l’interpréteur de commandes Windows.

S’applique à