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. 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必须可用作本机资源。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.

适用于

另请参阅