語言

JumpList.GetJumpList(Application) 方法

定義

回傳 JumpList 與應用程式相關聯的物件。

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

參數

application
Application

與 JumpList. 相關的應用程式。

傳回

與 JumpList 指定應用程式相關的物件。

範例

以下範例說明如何取得 JumpList 與目前應用程式相關聯的 。 A JumpTask 會被 JumpItems 加入收藏並加入 「最近」 類別。 呼叫 Apply 方法,將更新後的 JumpList 套用到 Windows shell。 此範例是類別概述中較大範例 JumpList 的一部分。

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

備註

你可以呼叫 GetJumpList 該方法,取得 JumpList 目前與 Application. .NET 框架不要求目前套用於 Windows shell 的 JumpList。

適用於