JumpList.GetJumpList(Application) Methode

Definition

Gibt das objekt zurück, das JumpList einer Anwendung zugeordnet ist.

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 Anwendung, die der JumpList.

Gibt zurück

Das JumpList objekt, das der angegebenen Anwendung zugeordnet ist.

Beispiele

Das folgende Beispiel zeigt, wie sie die JumpList aktuelle Anwendung zugeordnet erhalten. A JumpTask wird der JumpItems Auflistung hinzugefügt und der Kategorie "Zuletzt verwendet" hinzugefügt. Die methode Apply 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 JumpList aktuell zugeordnete Methode Applicationabzurufen. Das .NET Framework erfordert nicht, dass dies die JumpList ist, die derzeit auf die Windows Shell angewendet wird.

Gilt für: