JumpList.GetJumpList(Application) JumpList.GetJumpList(Application) JumpList.GetJumpList(Application) Method

定义

返回与某个应用程序关联的 JumpList 对象。Returns the JumpList object associated with an application.

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

参数

application
Application Application Application

JumpList 关联的应用程序。The application associated with the JumpList.

返回

与指定应用程序关联的 JumpList 对象。The JumpList object associated with the specified application.

示例

下面的示例演示如何获取与当前JumpList应用程序关联的。The following example shows how to get the JumpList associated with the current application. 添加到集合中并添加到最近的类别。 JumpTask JumpItemsA JumpTask is added to the JumpItems collection and added to the Recent category. 调用方法以将更新JumpList应用到 Windows shell。 ApplyThe Apply method is called to apply the updated JumpList to the Windows shell. 此示例是JumpList类概述中提供的一个更大示例的一部分。This example is part of a larger example available in the JumpList class overview.

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方法来获取当前与Application关联JumpList的。You can call the GetJumpList method to get the JumpList currently associated with an Application. .NET Framework 不需要此JumpList为当前应用于 Windows shell 的。The .NET Framework does not require that this be the JumpList that is currently applied to the Windows shell.

适用于