JumpTask.IconResourcePath Property

.NET Framework (current version)

Gets or sets the path to a resource that contains the icon to display in the Jump List.

Namespace:   System.Windows.Shell
Assembly:  PresentationFramework (in PresentationFramework.dll)

public string IconResourcePath { get; set; }

Property Value

Type: System.String

The path to a resource that contains the icon. The default is null.

An icon used with a JumpTask must be available as a native resource. 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. To specify that no icon is displayed, set the IconResourceIndex property to -1.

The following example shows how to declare a JumpTask in markup. The JumpTask opens a text file named readme.txt in the Notepad application.

<JumpTask Title="Read Me" 
          Description="Open readme.txt in Notepad." 

The following example shows how to configure a JumpTask in code. 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";

.NET Framework
Available since 4.0
Return to top