JumpTask JumpTask JumpTask JumpTask Class

定义

表示某应用程序在 Windows 7 任务栏跳转列表中的快捷方式。Represents a shortcut to an application in the Windows 7 taskbar Jump List.

public ref class JumpTask : System::Windows::Shell::JumpItem
public class JumpTask : System.Windows.Shell.JumpItem
type JumpTask = class
    inherit JumpItem
Public Class JumpTask
Inherits JumpItem
继承

示例

下面的示例演示如何声明JumpTask标记中。The following example shows how to declare a JumpTask in markup. JumpTask将打开一个名为文本文件readme.txt记事本应用程序中。The JumpTask opens a text file named readme.txt in the Notepad application.

<JumpTask Title="Read Me" 
          Description="Open readme.txt in Notepad." 
          ApplicationPath="C:\Windows\notepad.exe"
          IconResourcePath="C:\Windows\System32\imageres.dll"
          IconResourceIndex="14"
          WorkingDirectory="C:\Users\Public\Documents"
          Arguments="readme.txt"/>

下面的示例演示如何配置JumpTask在代码中。The following example shows how to configure a JumpTask in code. JumpTask打开计算器应用程序。The JumpTask opens the Calculator application.

// 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";

注解

一个JumpTask可视为应用程序的快捷方式。A JumpTask can be thought of as a shortcut to an application. 通过设置指定的可执行文件的路径ApplicationPath属性。You specify the path to the executable file by setting the ApplicationPath property. 如果ApplicationPath未设置,则暗示当前正在运行的进程的路径。If the ApplicationPath is not set, the path of the current running process is implied. 您可以选择指定Arguments要传递给在启动应用程序。You can optionally specify Arguments to pass to the application at startup.

你可以设置基本显示属性,如TitleDescription,和IconResourcePath跳转列表中指定任务的外观。You can set basic display properties, such as Title, Description, and IconResourcePath to specify the appearance of the task in the Jump List. 与一起使用的图标JumpTask必须可用作本机资源。An icon used with a JumpTask must be available as a native resource. 如果多个图标资源的 DLL 或可执行文件中,指定是要使用通过指示中的偏移量IconResourceIndex属性。If multiple icon resources are available in a DLL or executable file, you specify the one to use by indicating an offset in the IconResourceIndex property.

默认情况下JumpTask将被放入任务跳转列表的类别。By default, a JumpTask will be placed in the Tasks category of the Jump List. 可以通过设置指定的任务的自定义分组CustomCategory属性。You can specify custom grouping of tasks by setting the CustomCategory property.

通过创建来直观地分隔跳转列表中的项JumpTask不具有TitleCustomCategory指定。You can visually separate items in a Jump List by creating a JumpTask that does not have a Title and CustomCategory specified. 此空JumpTask将显示为一条水平线跳转列表中。This empty JumpTask will be displayed as a horizontal line in the Jump List. 在这种情况下,可以设置其他属性,但它们没有任何影响。In this case, other properties can be set, but they will not have any effect.

构造函数

JumpTask() JumpTask() JumpTask() JumpTask()

初始化 JumpTask 类的新实例。Initializes a new instance of the JumpTask class.

属性

ApplicationPath ApplicationPath ApplicationPath ApplicationPath

获取或设置应用程序的路径。Gets or sets the path to the application.

Arguments Arguments Arguments Arguments

获取或设置启动时要传递给应用程序的参数。Gets or sets the arguments passed to the application on startup.

CustomCategory CustomCategory CustomCategory CustomCategory

获取或设置在 Windows 7Windows 7 任务栏跳转列表中对 JumpItem 进行分组所依据的类别的名称。Gets or sets the name of the category the JumpItem is grouped with in the Windows 7Windows 7 taskbar Jump List.

(Inherited from JumpItem)
Description Description Description Description

获取或设置针对跳转列表中的任务在工具提示中显示的文本。Gets or sets the text displayed in the tooltip for the task in the Jump List.

IconResourceIndex IconResourceIndex IconResourceIndex IconResourceIndex

获取或设置嵌入在资源中的图标的索引,索引从零开始。Gets or sets the zero-based index of an icon embedded in a resource.

IconResourcePath IconResourcePath IconResourcePath IconResourcePath

获取或设置资源的路径,该资源包含要在跳转列表中显示的图标。Gets or sets the path to a resource that contains the icon to display in the Jump List.

Title Title Title Title

获取或设置针对跳转列表中的任务显示的文本。Gets or sets the text displayed for the task in the Jump List.

WorkingDirectory WorkingDirectory WorkingDirectory WorkingDirectory

获取或设置启动时应用程序的工作目录。Gets or sets the working directory of the application on startup.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

适用于

另请参阅