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

Das der angegebenen Anwendung zugeordnete JumpList-Objekt.

Beispiele

Das folgende Beispiel zeigt, wie Sie die JumpList der aktuellen Anwendung zugeordnete abrufen. Ein JumpTask wird der JumpItems Auflistung hinzugefügt und der Kategorie Zuletzt hinzugefügt. Die Apply Methode wird aufgerufen, um die aktualisierte 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 abzurufen, die JumpList derzeit einem Applicationzugeordnet ist. Die .NET Framework erfordert nicht, dass dies die ist, die JumpList derzeit auf die Windows-Shell angewendet wird.

Gilt für: