JumpTask.Title JumpTask.Title JumpTask.Title JumpTask.Title Property

定义

获取或设置针对跳转列表中的任务显示的文本。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

属性值

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

示例

下面的示例演示如何声明JumpTask标记中。The 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"/>

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

注解

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

或者,你以可视方式可以通过创建分隔跳转列表中的项JumpTask不具有TitleCustomCategory指定。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.

适用于