JumpList.GetJumpList(Application) Methode

Definition

Gibt das mit einer Anwendung verknüpfte JumpList-Objekt zurück.

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

Parameter

application
Application

Die dem JumpList-Objekt zugeordnete Anwendung.

Gibt zurück

JumpList

Das der angegebenen Anwendung zugeordnete JumpList-Objekt.

Beispiele

Im folgenden Beispiel wird gezeigt, wie Sie die JumpList dem aktuellen Anwendungs zugeordnete Anwendung abrufen. Eine JumpTask wird der JumpItems Auflistung hinzugefügt und der Kategorie "Zuletzt verwendet" hinzugefügt. Die Apply Methode wird aufgerufen, um die aktualisierung JumpList auf die Windows Shell anzuwenden. Dieses Beispiel ist Teil eines größeren Beispiels, das in der JumpList Klassenübersicht verfügbar ist.

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

Hinweise

Sie können die GetJumpList Methode aufrufen, um die JumpList aktuell zugeordnete ApplicationMethode abzurufen. Die .NET Framework erfordert nicht, dass dies die JumpList derzeit auf die Windows Shell angewendet wird.

Gilt für: