JumpList.SetJumpList(Application, JumpList) Méthode

Définition

Définit l'objet JumpList associé à une application.

public:
 static void SetJumpList(System::Windows::Application ^ application, System::Windows::Shell::JumpList ^ value);
public static void SetJumpList (System.Windows.Application application, System.Windows.Shell.JumpList value);
static member SetJumpList : System.Windows.Application * System.Windows.Shell.JumpList -> unit
Public Shared Sub SetJumpList (application As Application, value As JumpList)

Paramètres

application
Application

Application associée à JumpList.

value
JumpList

JumpList à associer à l'application.

Exemples

L’exemple suivant montre comment créer un JumpList code dans le code. La méthode statique SetJumpList est appelée pour associer l’application JumpList actuelle. Il JumpList est automatiquement appliqué à l’interpréteur de commandes Windows lorsqu’il est défini. Cet exemple fait partie d’un exemple plus large disponible dans la vue d’ensemble de la JumpList classe.

private void SetNewJumpList(object sender, RoutedEventArgs e)
{
    //Configure a new JumpTask
    JumpTask jumpTask1 = new JumpTask();
    // Get the path to WordPad and set the JumpTask properties.
    jumpTask1.ApplicationPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "write.exe");
    jumpTask1.IconResourcePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "write.exe");
    jumpTask1.Title = "WordPad";
    jumpTask1.Description = "Open WordPad.";
    jumpTask1.CustomCategory = "Jump List 2";
    // Create and set the new JumpList.
    JumpList jumpList2 = new JumpList();
    jumpList2.JumpItems.Add(jumpTask1);
    JumpList.SetJumpList(App.Current, jumpList2);
}

Remarques

Vous pouvez créer plusieurs JumpList objets. Toutefois, un JumpList seul à la fois peut être associé à un Application. Appelez la SetJumpList méthode pour définir l’élément JumpList actuellement associé à un Application.

S’applique à