JumpTask.Title Property

Definition

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

public:
 property System::String ^ Title { System::String ^ get(); void set(System::String ^ value); };
public string Title { get; set; }
member this.Title : string with get, set
Public Property Title As String

Property Value

String

针对跳转列表中的任务显示的文本。The text displayed for the task in the Jump List. 默认值为 nullThe default is null.

Examples

下面的示例演示如何在标记中声明 JumpTaskThe following example shows how to declare a JumpTask in markup. JumpTask 在记事本应用程序 readme.txt 打开一个文本文件名称。The JumpTask opens a text file name 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"/>

下面的示例演示如何在代码中配置 JumpTaskThe 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";

Remarks

通常,必须设置 Title 属性,JumpTask 才能作为可单击任务出现在 "跳转列表" 中。Typically, the Title property must be set for the JumpTask to appear in the Jump List as a clickable task.

或者,您可以通过创建一个没有 TitleCustomCategory 指定的 JumpTask,直观地分隔跳转列表中的项。Alternatively, 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.

Applies to