JumpTask.ApplicationPath Property

.NET Framework (current version)
 

Gets or sets the path to the application.

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

public string ApplicationPath { get; set; }

Property Value

Type: System.String

The path to the application. The default is null.

If the ApplicationPath property is not specified, then the path of the current running process is implied. An application can contain tasks for executables other than itself.

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." 
          ApplicationPath="C:\Windows\notepad.exe"
          IconResourcePath="C:\Windows\System32\imageres.dll"
          IconResourceIndex="14"
          WorkingDirectory="C:\Users\Public\Documents"
          Arguments="readme.txt"/>

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
Show: