Gets or sets the URL or file path which is the target of the Link.

Namespace:  ESRI.ArcGISExplorer.Mapping

Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)

Syntax

C#
public string Path { get; set; }
Visual Basic (Declaration)
Public Property Path As String

Field Value

A string representing a URL or file path.

Remarks

A Link is a type of map content that contains a reference to a URL or file path; the Path property stores the path of the URL or file. Double-clicking a Link in the Contents window will open the URL or file path; see the Launch()()() method for more information.

The Path property is not checked for correctness when created and can be set to a non-existent or inaccessible file path when created; however errors may occur when the Link is launched. An overloaded constructor is available which can help find errors in URL paths when the Link is constructed.

Examples

The code below finds all Links in the Map using the GetMapItems method on the Map class. Then providing there is at least one Link, launches the first link found using the Launch method. If the Launch throws a Win32Exception, the Path property is used to retrieve the file extension of the target of the Link in order to report the failure to the user.
CopyC#
// Find all the Links in the Map.
ESRI.ArcGISExplorer.Mapping.MapDisplay disp = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay;
System.Collections.ObjectModel.ReadOnlyCollection<Link> allLinks = disp.Map.GetMapItems<Link>();

// If there is at least one Link.
if (allLinks.Count > 0)
{
  try
  {
    // Launch the link.
    allLinks[0].Launch();
  }
  catch (System.ComponentModel.Win32Exception)
  {
    // Catch cases where the file type cannot be launched.
    string ext = System.IO.Path.GetExtension(allLinks[0].Path);
    MessageBox.Show("Could not find an associated application for the file type: " + ext);
  }
}
CopyVB.NET
' Find all the Links in the Map.
Dim disp As ESRI.ArcGISExplorer.Mapping.MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay
Dim allLinks As System.Collections.ObjectModel.ReadOnlyCollection(Of Link) = disp.Map.GetMapItems(Of Link)()

' If there is at least one Link.
If allLinks.Count > 0 Then
  Try
    ' Launch the link.
    allLinks(0).Launch()

  Catch ex As System.ComponentModel.Win32Exception
    ' Catch cases where the file type cannot be launched.
    Dim ext As String = System.IO.Path.GetExtension(allLinks(0).Path)
    MessageBox.Show("Could not find an associated application for the file type: " & ext)

  End Try
End If

See Also