JumpTask.IconResourcePath JumpTask.IconResourcePath JumpTask.IconResourcePath JumpTask.IconResourcePath Property

定义

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

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

属性值

包含图标的资源的路径。The path to a resource that contains the icon. 默认值为 nullThe default is null.

示例

下面的示例演示如何JumpTask在标记中声明。The following example shows how to declare a JumpTask in markup. 在记事本应用程序中readme.txt 打开一个名为的文本文件。JumpTaskThe 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必须作为本机资源提供。An icon used with a JumpTask must be available as a native resource. 如果 DLL 或可执行文件中有多个图标, 则可以通过指示IconResourceIndex属性中的偏移量来指定要使用的图标。If multiple icons are available in a DLL or executable file, you specify the one to use by indicating an offset in the IconResourceIndex property.

如果未指定图标资源, 或者如果找不到指定的图标, 则显示标准系统图标。If no icon resource is specified, or if the specified icon is not found, the standard system icon is displayed. 若要指定不显示图标, 请将IconResourceIndex属性设置为-1。To specify that no icon is displayed, set the IconResourceIndex property to -1.

适用于

另请参阅