JumpList.GetJumpList(Application) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
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 au JumpList.
Retours
Objet JumpList associé à l’application spécifiée.
Exemples
L’exemple suivant montre comment obtenir l’associé JumpList à l’application actuelle. A JumpTask est ajouté à la JumpItems collection et ajouté à la catégorie Récente . La méthode Apply est appelée pour appliquer le JumpList mis à jour au shell 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 méthode pour obtenir l’élément GetJumpListJumpList actuellement associé à un Application. Le framework .NET ne nécessite pas qu’il s’agit de l'JumpList actuellement appliqué à l’interpréteur de commandes Windows.